mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
p2p: Ignore version msgs after initial version msg
Sending a version message after the intial version message is peer misbehavior. Though, it seems arbitrary and confusing to disconnect only after exactly 100 version messages. Duplicate version messages affect us no different than any other unknown message. So remove the Misbehaving and ignore the redundant msgs.
This commit is contained in:
@@ -2286,10 +2286,8 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
|
||||
if (peer == nullptr) return;
|
||||
|
||||
if (msg_type == NetMsgType::VERSION) {
|
||||
// Each connection can only send one version message
|
||||
if (pfrom.nVersion != 0)
|
||||
{
|
||||
Misbehaving(pfrom.GetId(), 1, "redundant version message");
|
||||
if (pfrom.nVersion != 0) {
|
||||
LogPrint(BCLog::NET, "redundant version message from peer=%d\n", pfrom.GetId());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user