aboutsummaryrefslogtreecommitdiff
path: root/src/pow.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-06-25 09:14:14 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-06-25 09:14:36 +0200
commit208bf5b9e0a86900bddf5722dc192c3262480e36 (patch)
treeb70a86a5daf38ff1846a58340aefb27779d693e0 /src/pow.h
parent27383b9015e204ac834d5df00737fe23bb042bc4 (diff)
parentfd704c7b2c5ab8b24b1829f000b829d7156b8b3c (diff)
downloadbitcoin-208bf5b9e0a86900bddf5722dc192c3262480e36.tar.xz
Merge pull request #3839
fd704c7 move pow constants to chainparams (jtimon) df852d2 Refactor proof of work related functions out of main (jtimon)
Diffstat (limited to 'src/pow.h')
-rw-r--r--src/pow.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pow.h b/src/pow.h
new file mode 100644
index 0000000000..0ce5b48766
--- /dev/null
+++ b/src/pow.h
@@ -0,0 +1,23 @@
+
+// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2009-2014 The Bitcoin developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef BITCOIN_POW_H
+#define BITCOIN_POW_H
+
+#include <stdint.h>
+
+class CBlockIndex;
+class CBlockHeader;
+class uint256;
+
+unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock);
+
+/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
+bool CheckProofOfWork(uint256 hash, unsigned int nBits);
+/** Calculate the minimum amount of work a received block needs, without knowing its direct parent */
+unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime);
+
+#endif