From af4e79735c3f97d4228472077bcd5d2ddfb2cb93 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 13 Feb 2017 16:38:21 -0800 Subject: Fix "orbit" semantics. Federation works. --- node/IncomingPacket.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'node/IncomingPacket.cpp') diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp index 41a06937..b077f7e2 100644 --- a/node/IncomingPacket.cpp +++ b/node/IncomingPacket.cpp @@ -455,16 +455,16 @@ bool IncomingPacket::_doOK(const RuntimeEnvironment *RR,const SharedPtr &p // Handle planet or moon updates if present if ((ptr + 2) <= size()) { - const unsigned int worldLen = at(ptr); ptr += 2; - if (RR->topology->isUpstream(peer->identity())) { - const unsigned int endOfWorlds = ptr + worldLen; + const unsigned int worldsLen = at(ptr); ptr += 2; + if (RR->topology->shouldAcceptWorldUpdateFrom(peer->address())) { + const unsigned int endOfWorlds = ptr + worldsLen; while (ptr < endOfWorlds) { World w; ptr += w.deserialize(*this,ptr); RR->topology->addWorld(w,false); } } else { - ptr += worldLen; + ptr += worldsLen; } } -- cgit v1.2.3