]> Git Repo - VerusCoin.git/blob - src/pow.h
Auto merge of #1127 - ebfull:test-merkle-tree-gadget, r=ebfull
[VerusCoin.git] / src / pow.h
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2014 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6 #ifndef BITCOIN_POW_H
7 #define BITCOIN_POW_H
8
9 #include "consensus/params.h"
10
11 #include <stdint.h>
12
13 class CBlockHeader;
14 class CBlockIndex;
15 class CChainParams;
16 class uint256;
17 class arith_uint256;
18
19 unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);
20 unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params&);
21 unsigned int CalculateNextWorkRequired(uint32_t nBits, int64_t nLastBlockTime, int64_t nFirstBlockTime, const Consensus::Params&);
22
23 /** Check whether the Equihash solution in a block header is valid */
24 bool CheckEquihashSolution(const CBlockHeader *pblock, const CChainParams&);
25
26 /** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
27 bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&);
28 arith_uint256 GetBlockProof(const CBlockIndex& block);
29
30 /** Return the time it would take to redo the work difference between from and to, assuming the current hashrate corresponds to the difficulty at tip, in seconds. */
31 int64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& from, const CBlockIndex& tip, const Consensus::Params&);
32
33 #endif // BITCOIN_POW_H
This page took 0.025852 seconds and 4 git commands to generate.