Browse Source

Merge pull request #4471

40f5cb8 Send rejects and apply DoS scoring for errors in direct block validation. (Pieter Wuille)
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
c6ac5fcfc2
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 10
      src/main.cpp

10
src/main.cpp

@ -3982,6 +3982,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, @@ -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);
}
}
}

Loading…
Cancel
Save