diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-10-27 22:42:44 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-10-27 22:42:44 -0700 |
commit | cd1fc2434ce80f50242e41b5e675f6d0b36045ad (patch) | |
tree | e0729ec1713fa42a00d14c2fb41c201fa09ec7c9 /src | |
parent | aa5822f9c3a71818231101b414bd90f5eb40f356 (diff) | |
parent | a27253dc007faaa37efa090a26c2515522efc141 (diff) |
Merge pull request #3164 from TheBlueMatt/master
Re-enable BitcoindComparisonTool on pull-tester
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 4 | ||||
-rw-r--r-- | src/main.h | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 6ffbc5a44e..56bd7a5cfd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2355,7 +2355,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo uniqueTx.insert(block.GetTxHash(i)); } if (uniqueTx.size() != block.vtx.size()) - return state.DoS(100, error("CheckBlock() : duplicate transaction")); + return state.DoS(100, error("CheckBlock() : duplicate transaction"), true); unsigned int nSigOps = 0; BOOST_FOREACH(const CTransaction& tx, block.vtx) @@ -3783,7 +3783,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) LOCK(cs_main); CValidationState state; - if (ProcessBlock(state, pfrom, &block)) + if (ProcessBlock(state, pfrom, &block) || state.CorruptionPossible()) mapAlreadyAskedFor.erase(inv); int nDoS = 0; if (state.IsInvalid(nDoS)) diff --git a/src/main.h b/src/main.h index 76de47071e..2a67747b47 100644 --- a/src/main.h +++ b/src/main.h @@ -946,13 +946,15 @@ private: MODE_ERROR, // run-time error } mode; int nDoS; + bool corruptionPossible; public: CValidationState() : mode(MODE_VALID), nDoS(0) {} - bool DoS(int level, bool ret = false) { + bool DoS(int level, bool ret = false, bool corruptionIn = false) { if (mode == MODE_ERROR) return ret; nDoS += level; mode = MODE_INVALID; + corruptionPossible = corruptionIn; return ret; } bool Invalid(bool ret = false) { @@ -982,6 +984,9 @@ public: } return false; } + bool CorruptionPossible() { + return corruptionPossible; + } }; /** An in-memory indexed chain of blocks. */ |