Merge pull request #4471
40f5cb8
Send rejects and apply DoS scoring for errors in direct block validation. (Pieter Wuille)
This commit is contained in:
commit
c6ac5fcfc2
1 changed files with 10 additions and 0 deletions
10
src/main.cpp
10
src/main.cpp
|
@ -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…
Add table
Reference in a new issue