aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-07-07 17:29:21 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-07-07 17:31:05 +0200
commitc6ac5fcfc233e5346c73b32eed79cfe8e9fa6392 (patch)
treeafe9e777ecab3821965046be566d4e8c7304b9dd
parentf748ff730b4570a19610db67aa9ded28ba98a8c5 (diff)
parent40f5cb878edd04b4be14f0d73ab706dc2e69124c (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.cpp10
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);
+ }
+ }
+
}