diff options
| author | Gavin Andresen <[email protected]> | 2011-09-06 16:59:38 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-09-21 12:50:12 -0400 |
| commit | 3e52aaf2121d597ab1ed012b65e37f9cb5f2754e (patch) | |
| tree | 67680efdeb0611d17e2607ab049cf846f14c9316 /src/main.h | |
| parent | Framework for banning mis-behaving peers (diff) | |
| download | discoin-3e52aaf2121d597ab1ed012b65e37f9cb5f2754e.tar.xz discoin-3e52aaf2121d597ab1ed012b65e37f9cb5f2754e.zip | |
Transaction/Block denial-of-service detection/response
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 c400145d0..3e1371abb 100644 --- a/src/main.h +++ b/src/main.h @@ -399,6 +399,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() { @@ -420,6 +423,7 @@ public: vin.clear(); vout.clear(); nLockTime = 0; + nDoS = 0; // Denial-of-service prevention } bool IsNull() const @@ -786,6 +790,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() { @@ -819,6 +826,7 @@ public: nNonce = 0; vtx.clear(); vMerkleTree.clear(); + nDoS = 0; } bool IsNull() const |