diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-07 17:29:21 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-07 17:31:05 +0200 |
commit | c6ac5fcfc233e5346c73b32eed79cfe8e9fa6392 (patch) | |
tree | afe9e777ecab3821965046be566d4e8c7304b9dd | |
parent | f748ff730b4570a19610db67aa9ded28ba98a8c5 (diff) | |
parent | 40f5cb878edd04b4be14f0d73ab706dc2e69124c (diff) |
Merge pull request #4471
40f5cb8 Send rejects and apply DoS scoring for errors in direct block validation. (Pieter Wuille)
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index f0ecda9768..a9c080ffae 100644 --- a/src/main.cpp +++ b/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); + } + } + } |