]> Git Repo - VerusCoin.git/blame - src/pow.h
Replace http with https: in links to the MIT license.
[VerusCoin.git] / src / pow.h
CommitLineData
df852d2b 1// Copyright (c) 2009-2010 Satoshi Nakamoto
f914f1a7 2// Copyright (c) 2009-2014 The Bitcoin Core developers
78253fcb 3// Distributed under the MIT software license, see the accompanying
bc909a7a 4// file COPYING or https://www.opensource.org/licenses/mit-license.php .
df852d2b 5
6#ifndef BITCOIN_POW_H
7#define BITCOIN_POW_H
8
d698ef69
JT
9#include "consensus/params.h"
10
df852d2b 11#include <stdint.h>
12
df852d2b 13class CBlockHeader;
611116d4 14class CBlockIndex;
fdda3c50 15class CChainParams;
df852d2b 16class uint256;
734f85c4 17class arith_uint256;
df852d2b 18
d698ef69 19unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);
29842505
JG
20unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg,
21 int64_t nLastBlockTime, int64_t nFirstBlockTime,
22 const Consensus::Params&);
df852d2b 23
fdda3c50 24/** Check whether the Equihash solution in a block header is valid */
cea06a4f 25bool CheckEquihashSolution(const CBlockHeader *pblock, const Consensus::Params&);
fdda3c50 26
df852d2b 27/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
d698ef69 28bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&);
734f85c4 29arith_uint256 GetBlockProof(const CBlockIndex& block);
b343c1a1 30
f7303f97
PW
31/** 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. */
32int64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& from, const CBlockIndex& tip, const Consensus::Params&);
33
093303a8 34#endif // BITCOIN_POW_H
This page took 0.143985 seconds and 4 git commands to generate.