initialize node data maps
This commit is contained in:
		@@ -94,6 +94,7 @@ func Join(ctx context.Context, cl Client, addr netip.AddrPort, np Peer) (*Node,
 | 
				
			|||||||
		self:    self,
 | 
							self:    self,
 | 
				
			||||||
		succ:    s,
 | 
							succ:    s,
 | 
				
			||||||
		fingers: make([]Peer, 0, 8*len(ID{})),
 | 
							fingers: make([]Peer, 0, 8*len(ID{})),
 | 
				
			||||||
 | 
							data:    make(map[ID]string),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return r, nil
 | 
						return r, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -205,6 +205,7 @@ func Create(addr netip.AddrPort) (*Node, error) {
 | 
				
			|||||||
		self:    self,
 | 
							self:    self,
 | 
				
			||||||
		succ:    []Peer{self}[:1:1], // extra cautious about capacity
 | 
							succ:    []Peer{self}[:1:1], // extra cautious about capacity
 | 
				
			||||||
		fingers: make([]Peer, 0, len(ID{})*8),
 | 
							fingers: make([]Peer, 0, len(ID{})*8),
 | 
				
			||||||
 | 
							data:    make(map[ID]string),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return n, nil
 | 
						return n, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user