diff --git a/router/connection.go b/router/connection.go index a22eeb27..87fb82a2 100644 --- a/router/connection.go +++ b/router/connection.go @@ -492,6 +492,7 @@ func (conn *LocalConnection) receiveTCP(decoder *gob.Decoder, usingPassword bool if len(newUpdate) == 0 { continue } + conn.Router.Topology.RebuildRoutes() conn.local.BroadcastTCP(Concat(ProtocolUpdateByte, newUpdate)) } else if msg[0] == ProtocolPMTUVerified { conn.verifyPMTU <- int(binary.BigEndian.Uint16(msg[1:])) diff --git a/router/peer.go b/router/peer.go index 684a4eb2..b27e621d 100644 --- a/router/peer.go +++ b/router/peer.go @@ -389,13 +389,13 @@ func (peer *Peer) handleConnectionEstablished(conn *LocalConnection) { } func (peer *Peer) handleBroadcastTCP(msg []byte) { - peer.Router.Topology.RebuildRoutes() peer.ForEachConnection(func(_ PeerName, conn Connection) { conn.(*LocalConnection).SendTCP(msg) }) } func (peer *Peer) broadcastPeerUpdate(peers ...*Peer) { + peer.Router.Topology.RebuildRoutes() peer.handleBroadcastTCP(Concat(ProtocolUpdateByte, EncodePeers(append(peers, peer)...))) }