Przeglądaj źródła

Fix getPeer(self) bug if I am the controller.

Adam Ierymenko 9 lat temu
rodzic
commit
7b7ab823b0
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      node/Multicaster.cpp

+ 3 - 1
node/Multicaster.cpp

@@ -228,7 +228,9 @@ void Multicaster::send(
 				gs.lastExplicitGather = now;
 				SharedPtr<Peer> 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<Peer> &p = explicitGatherPeers[k];
 					if (!p)