|
@@ -576,8 +576,11 @@ class RelayChannelManager(ChannelManager):
|
|
|
if isinstance(msg, RelayRandomHopMsg):
|
|
|
if msg.ttl > 0:
|
|
|
# Pick a random next hop from the consensus
|
|
|
- nexthop = random.choice(self.consensus.consdict['relays'])
|
|
|
- nextaddr = nexthop.descdict['addr']
|
|
|
+ nexthop = relaypicker.pick_weighted_relay()
|
|
|
+ if network.thenetwork.womode == network.WOMode.VANILLA:
|
|
|
+ nextaddr = nexthop.descdict["addr"]
|
|
|
+ else:
|
|
|
+ nextaddr = nexthop.snipdict["addr"]
|
|
|
self.send_msg(RelayRandomHopMsg(msg.ttl-1), nextaddr)
|
|
|
elif isinstance(msg, RelayGetConsensusMsg):
|
|
|
self.send_msg(RelayConsensusMsg(self.consensus), peeraddr)
|
|
@@ -784,7 +787,7 @@ if __name__ == '__main__':
|
|
|
|
|
|
print('ticked; epoch=', network.thenetwork.getepoch())
|
|
|
|
|
|
- # relays[3].channelmgr.send_msg(RelayRandomHopMsg(30), relays[5].netaddr)
|
|
|
+ relays[3].channelmgr.send_msg(RelayRandomHopMsg(30), relays[5].netaddr)
|
|
|
|
|
|
# See what channels exist and do a consistency check
|
|
|
for r in relays:
|