diff --git a/src/network/connectionthreads.cpp b/src/network/connectionthreads.cpp index 03771b33f..ed2bcd0b6 100644 --- a/src/network/connectionthreads.cpp +++ b/src/network/connectionthreads.cpp @@ -1018,6 +1018,13 @@ void ConnectionReceiveThread::receive(SharedBuffer &packetdata, peer->SetFullyOpen(); // Setup phase has a fixed timeout peer->ResetTimeout(); + } else if (!peer->isHalfOpen()) { + // If the peer talks to us without a peer ID when it has done so + // before something is definitely fishy. + LOG(derr_con << m_connection->getDesc() + << " Peer " << peer_id << " sending without peer id?!" + " Ignoring." << std::endl); + return; } auto *udpPeer = dynamic_cast(&peer);