diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-09-26 06:06:16 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-09-26 06:06:16 -0700 |
commit | 17e2c24645a10354849dec917b31f364e9056d58 (patch) | |
tree | 0fc4eda5307bbc9dc99eb3c8fec40b303644cd1c /src/main.h | |
parent | f7f2a36925bb560363f691fc3ca3dec83830dd15 (diff) | |
parent | 806704c237890527ca2a7bab4c97550431eebea0 (diff) |
Merge pull request #517 from gavinandresen/DoSprevention
Denial-of-service prevention
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.h b/src/main.h index a8deb2b92b..1106bb9785 100644 --- a/src/main.h +++ b/src/main.h @@ -400,6 +400,9 @@ public: std::vector<CTxOut> vout; unsigned int nLockTime; + // Denial-of-service detection: + mutable int nDoS; + bool DoS(int nDoSIn, bool fIn) const { nDoS += nDoSIn; return fIn; } CTransaction() { @@ -421,6 +424,7 @@ public: vin.clear(); vout.clear(); nLockTime = 0; + nDoS = 0; // Denial-of-service prevention } bool IsNull() const @@ -787,6 +791,9 @@ public: // memory only mutable std::vector<uint256> vMerkleTree; + // Denial-of-service detection: + mutable int nDoS; + bool DoS(int nDoSIn, bool fIn) const { nDoS += nDoSIn; return fIn; } CBlock() { @@ -820,6 +827,7 @@ public: nNonce = 0; vtx.clear(); vMerkleTree.clear(); + nDoS = 0; } bool IsNull() const |