remove UnknownPeerError

when encountering an unknown peer in received gossip, rather than
ignoring the entire gossip we create a placeholder Peer. This has
version 0 and uid 0, which means it will be replaced by any complete
peer information subsequently received via gossip.
This commit is contained in:
Matthias Radestock committed 2015-11-30 16:17:16 +00:00
1 parent eb9b5b535f
commit 7e15eabe65
3 files changed
+14 -25

No files matched your search

-8
View File
@@ -172,14 +172,6 @@ func (router *Router) OnGossip(update []byte) (GossipData, error) {
func (router *Router) applyTopologyUpdate(update []byte) (PeerNameSet, PeerNameSet, error) {
origUpdate, newUpdate, err := router.Peers.ApplyUpdate(update)
if _, ok := err.(UnknownPeerError); err != nil && ok {
// That update contained a reference to a peer which wasn't
// itself included in the update, and we didn't know about
// already. We ignore this; eventually we should receive an
// update containing a complete topology.
log.Println("Topology gossip:", err)
return nil, nil, nil
}
if err != nil {
return nil, nil, err
}