aboutsummaryrefslogtreecommitdiff
path: root/src/pow.h
diff options
context:
space:
mode:
authorjtimon <jtimon@monetize.io>2014-03-10 08:46:53 -0700
committerjtimon <jtimon@monetize.io>2014-06-23 23:10:24 +0200
commitdf852d2bcc6573a3fcb3e59f82f7ea4dfa11290e (patch)
treef8651a97cf4617ce0a867f964f5c70b0f2bf8090 /src/pow.h
parent36db6633c314b0f41aeee856f74a8d5d59334dbb (diff)
downloadbitcoin-df852d2bcc6573a3fcb3e59f82f7ea4dfa11290e.tar.xz
Refactor proof of work related functions out of main
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