Skip to content

Commit c6ac5fc

Browse files
committed
Merge pull request #4471
40f5cb8 Send rejects and apply DoS scoring for errors in direct block validation. (Pieter Wuille)
2 parents f748ff7 + 40f5cb8 commit c6ac5fc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3982,6 +3982,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
39823982

39833983
CValidationState state;
39843984
ProcessBlock(state, pfrom, &block);
3985+
int nDoS;
3986+
if (state.IsInvalid(nDoS)) {
3987+
pfrom->PushMessage("reject", strCommand, state.GetRejectCode(),
3988+
state.GetRejectReason(), inv.hash);
3989+
if (nDoS > 0) {
3990+
LOCK(cs_main);
3991+
Misbehaving(pfrom->GetId(), nDoS);
3992+
}
3993+
}
3994+
39853995
}
39863996

39873997

0 commit comments

Comments
 (0)