aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2014-07-07 17:29:21 +0200
committerWladimir J. van der Laan <[email protected]>2014-07-07 17:31:05 +0200
commitc6ac5fcfc233e5346c73b32eed79cfe8e9fa6392 (patch)
treeafe9e777ecab3821965046be566d4e8c7304b9dd /src/main.cpp
parentMerge pull request #4045 (diff)
parentSend rejects and apply DoS scoring for errors in direct block validation. (diff)
downloaddiscoin-c6ac5fcfc233e5346c73b32eed79cfe8e9fa6392.tar.xz
discoin-c6ac5fcfc233e5346c73b32eed79cfe8e9fa6392.zip
Merge pull request #4471
40f5cb8 Send rejects and apply DoS scoring for errors in direct block validation. (Pieter Wuille)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f0ecda976..a9c080ffa 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);
+ }
+ }
+
}