Skip to content

Commit de436d3

Browse files
committed
net_processing: add missing return to the process verack msg flow.
And don't count getspork/spork messages in the mnauth flow.
1 parent 747f838 commit de436d3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/net_processing.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
13371337
LogPrintf("New outbound peer connected: version: %d, blocks=%d, peer=%d%s\n",
13381338
pfrom->nVersion.load(), pfrom->nStartingHeight, pfrom->GetId(),
13391339
(fLogIPs ? strprintf(", peeraddr=%s", pfrom->addr.ToString()) : ""));
1340+
return true;
13401341
}
13411342

13421343
else if (strCommand == NetMsgType::SENDADDRV2) {
@@ -1349,7 +1350,6 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
13491350
// Must have a verack message before anything else
13501351
LOCK(cs_main);
13511352
Misbehaving(pfrom->GetId(), 1);
1352-
LogPrintf("ERROR Received %s before verack\n", strCommand);
13531353
return false;
13541354
}
13551355

@@ -1374,9 +1374,10 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
13741374
return true;
13751375
}
13761376

1377-
if (strCommand != NetMsgType::SENDADDRV2 && // todo: remove this..
1377+
if (strCommand != NetMsgType::GETSPORKS &&
1378+
strCommand != NetMsgType::SPORK &&
13781379
!pfrom->fFirstMessageReceived.exchange(true)) {
1379-
// First message after VERSION/VERACK (without counting the SENDADDRV2)
1380+
// First message after VERSION/VERACK (without counting the GETSPORKS/SPORK messages)
13801381
pfrom->fFirstMessageReceived = true;
13811382
pfrom->fFirstMessageIsMNAUTH = strCommand == NetMsgType::MNAUTH;
13821383
if (pfrom->m_masternode_probe_connection && !pfrom->fFirstMessageIsMNAUTH) {
@@ -1386,8 +1387,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
13861387
}
13871388
}
13881389

1389-
1390-
else if (strCommand == NetMsgType::ADDR || strCommand == NetMsgType::ADDRV2) {
1390+
if (strCommand == NetMsgType::ADDR || strCommand == NetMsgType::ADDRV2) {
13911391
int stream_version = vRecv.GetVersion();
13921392
if (strCommand == NetMsgType::ADDRV2) {
13931393
// Add ADDRV2_FORMAT to the version so that the CNetAddr and CAddress

0 commit comments

Comments
 (0)