aboutsummaryrefslogtreecommitdiff
path: root/src/pow.h
diff options
context:
space:
mode:
authorRoss Nicoll <jrn@jrn.me.uk>2015-02-21 12:57:44 +0000
committerRoss Nicoll <jrn@jrn.me.uk>2015-02-21 13:14:19 +0000
commit34e5015cd21e27c1bf635d92531afac93f553096 (patch)
tree0497bd7f74f211fd261ec173225ab8eca1760fdb /src/pow.h
parentaaba10f275059cd762c1f07597aa5efb24176cdd (diff)
Add unit tests for next difficulty calculations
Split GetNextWorkRequired() into two functions to allow the difficulty calculations to be tested without requiring a full blockchain. Add unit tests to cover basic difficulty calculation, plus each of the min/max actual time, and maximum difficulty target conditions.
Diffstat (limited to 'src/pow.h')
-rw-r--r--src/pow.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pow.h b/src/pow.h
index 3337a30a5e..a5fbba6236 100644
--- a/src/pow.h
+++ b/src/pow.h
@@ -14,6 +14,7 @@ class uint256;
class arith_uint256;
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock);
+unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime);
/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
bool CheckProofOfWork(uint256 hash, unsigned int nBits);