You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pow.h 1.2KB

  1. // Copyright (c) 2009-2010 Satoshi Nakamoto
  2. // Copyright (c) 2009-2015 The Bitcoin Core developers
  3. // Distributed under the MIT software license, see the accompanying
  4. // file COPYING or
  5. #ifndef BITCOIN_POW_H
  6. #define BITCOIN_POW_H
  7. #include "consensus/params.h"
  8. #include <stdint.h>
  9. class CBlockHeader;
  10. class CBlockIndex;
  11. class uint256;
  12. class arith_uint256;
  13. unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);
  14. unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params&);
  15. /** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
  16. bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&);
  17. arith_uint256 GetBlockProof(const CBlockIndex& block);
  18. /** 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. */
  19. int64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& from, const CBlockIndex& tip, const Consensus::Params&);
  20. #endif // BITCOIN_POW_H