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
10
src/main.cpp
10
src/main.cpp
|
@ -3982,6 +3982,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||||
|
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
ProcessBlock(state, pfrom, &block);
|
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…
Reference in New Issue