From 7b7ab823b0847d9bd4437a8a86b5bdf48590b79d Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 28 Jun 2016 22:49:01 +0000 Subject: [PATCH] Fix getPeer(self) bug if I am the controller. --- node/Multicaster.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node/Multicaster.cpp b/node/Multicaster.cpp index 1dfa67ddb..e1d4567a5 100644 --- a/node/Multicaster.cpp +++ b/node/Multicaster.cpp @@ -228,7 +228,9 @@ void Multicaster::send( gs.lastExplicitGather = now; SharedPtr explicitGatherPeers[2]; explicitGatherPeers[0] = RR->topology->getBestRoot(); - explicitGatherPeers[1] = RR->topology->getPeer(Network::controllerFor(nwid)); + const Address nwidc(Network::controllerFor(nwid)); + if (nwidc != RR->identity.address()) + explicitGatherPeers[1] = RR->topology->getPeer(nwidc); for(unsigned int k=0;k<2;++k) { const SharedPtr &p = explicitGatherPeers[k]; if (!p)