initialize node data maps

This commit is contained in:
Branden J Brown 2025-03-15 20:29:47 -04:00
parent 4a69e64654
commit bfc9fe5d56
2 changed files with 2 additions and 0 deletions

View File

@ -94,6 +94,7 @@ func Join(ctx context.Context, cl Client, addr netip.AddrPort, np Peer) (*Node,
self: self,
succ: s,
fingers: make([]Peer, 0, 8*len(ID{})),
data: make(map[ID]string),
}
return r, nil
}

View File

@ -205,6 +205,7 @@ func Create(addr netip.AddrPort) (*Node, error) {
self: self,
succ: []Peer{self}[:1:1], // extra cautious about capacity
fingers: make([]Peer, 0, len(ID{})*8),
data: make(map[ID]string),
}
return n, nil
}