diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-07-07 17:29:21 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-07-07 17:31:05 +0200 |
| commit | c6ac5fcfc233e5346c73b32eed79cfe8e9fa6392 (patch) | |
| tree | afe9e777ecab3821965046be566d4e8c7304b9dd /src/main.cpp | |
| parent | Merge pull request #4045 (diff) | |
| parent | Send rejects and apply DoS scoring for errors in direct block validation. (diff) | |
| download | discoin-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.cpp | 10 |
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); + } + } + } |