Merge pull request #4471

40f5cb8 Send rejects and apply DoS scoring for errors in direct block validation. (Pieter Wuille)
This commit is contained in:
Wladimir J. van der Laan 2014-07-07 17:29:21 +02:00
commit c6ac5fcfc2
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 10 additions and 0 deletions

View File

@ -3982,6 +3982,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
CValidationState state;
ProcessBlock(state, pfrom, &block);
int nDoS;
if (state.IsInvalid(nDoS)) {
pfrom->PushMessage("reject", strCommand, state.GetRejectCode(),
state.GetRejectReason(), inv.hash);
if (nDoS > 0) {
LOCK(cs_main);
Misbehaving(pfrom->GetId(), nDoS);
}
}
}