use routes based on tcp overlay connectivity for gossip

i.e. include asymmetric and non-established connections
This is TRTTD since gossip flows over the tcp overlay.
This commit is contained in:
Matthias Radestock committed 2015-04-04 21:56:30 +01:00
1 parent 3fba123bc0
commit 95c1e226f0
2 files changed
+60 -23

No files matched your search

+2 -2
View File
@@ -219,7 +219,7 @@ func (c *GossipChannel) GossipBroadcast(buf []byte) error {
}
func (c *GossipChannel) relayUnicast(dstPeerName PeerName, msg []byte) error {
if relayPeerName, found := c.ourself.Router.Routes.Unicast(dstPeerName); !found {
if relayPeerName, found := c.ourself.Router.Routes.UnicastAll(dstPeerName); !found {
c.log("unknown relay destination:", dstPeerName)
} else if conn, found := c.ourself.ConnectionTo(relayPeerName); !found {
c.log("unable to find connection to relay peer", relayPeerName)
@@ -230,7 +230,7 @@ func (c *GossipChannel) relayUnicast(dstPeerName PeerName, msg []byte) error {
}
func (c *GossipChannel) relayBroadcast(srcName PeerName, msg []byte) error {
nextHops := c.ourself.Router.Routes.Broadcast(srcName)
nextHops := c.ourself.Router.Routes.BroadcastAll(srcName)
if len(nextHops) == 0 {
return nil
}