don't transmit nil predecessors

This commit is contained in:
Branden J Brown 2025-03-11 09:27:45 -04:00
parent 93771480ff
commit 68ce8c5f34
2 changed files with 3 additions and 1 deletions

View File

@ -43,5 +43,5 @@ func readResponse[T any](r *http.Response) (x T, err error) {
type neighbors struct {
Succ []netip.AddrPort `json:"succ"`
Pred netip.AddrPort `json:"pred"`
Pred netip.AddrPort `json:"pred,omitzero"`
}

View File

@ -13,6 +13,8 @@ type Node struct {
// self is the node topology this server represents.
self *chord.Node
// client is the Chord client for forwarding queries to other nodes.
// TODO(branden): really we should have a client per peer so that we can
// interchange protocols
client chord.Client
}