Fix some bugs

This commit is contained in:
Neil Alexander 2022-05-27 16:59:58 +01:00
parent 9ccd008b23
commit 5e4dcd76c3
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -305,7 +305,7 @@ func (s *state) _handleBootstrap(from, to *peer, rx *types.Frame) bool {
case desc.PublicKey == rx.DestinationKey:
// We've received another bootstrap from our direct descending node.
// Accept the update as this is OK.
update = true
update = bootstrap.Sequence > desc.Watermark.Sequence
case util.DHTOrdered(desc.PublicKey, rx.DestinationKey, s.r.public):
// The bootstrapping node is closer to us than our previous descending
// node was.
@ -324,6 +324,7 @@ func (s *state) _handleBootstrap(from, to *peer, rx *types.Frame) bool {
}
if update {
s._setDescendingNode(s._table[index])
s._bootstrapSoon()
}
// If this is a higher key than that which we've seen, update our