Skip to content

Commit e6d2bd6

Browse files
committed
net_processing: Remove duplicate, and wrong, peer misbehaving due an invalid arriving block.
1) The actual peer misbehaving check is being performed inside PeerLogicValidation::BlockChecked. 2) The CValidationState inputted to ProcessNewBlock does not return the error nor invalidity reason if the block is marked as invalid during the activate best chain process (thus why BlockChecked exists).
1 parent 6a5df01 commit e6d2bd6

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/net_processing.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,14 +1703,6 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
17031703
if (!fAccepted) {
17041704
CheckBlockSpam(state, pfrom, hashBlock);
17051705
}
1706-
int nDoS;
1707-
if(state.IsInvalid(nDoS)) {
1708-
assert (state.GetRejectCode() < REJECT_INTERNAL); // Blocks are never rejected with internal reject codes
1709-
if(nDoS > 0) {
1710-
TRY_LOCK(cs_main, lockMain);
1711-
if(lockMain) Misbehaving(pfrom->GetId(), nDoS);
1712-
}
1713-
}
17141706
//disconnect this node if its old protocol version
17151707
pfrom->DisconnectOldProtocol(pfrom->nVersion, ActiveProtocol(), strCommand);
17161708
} else {

0 commit comments

Comments
 (0)