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.

miner.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 http://www.opensource.org/licenses/mit-license.php.
  5. #ifndef BITCOIN_MINER_H
  6. #define BITCOIN_MINER_H
  7. #include "primitives/block.h"
  8. #include <stdint.h>
  9. class CBlockIndex;
  10. class CChainParams;
  11. class CReserveKey;
  12. class CScript;
  13. class CWallet;
  14. namespace Consensus { struct Params; };
  15. static const bool DEFAULT_GENERATE = false;
  16. static const int DEFAULT_GENERATE_THREADS = 1;
  17. static const bool DEFAULT_PRINTPRIORITY = false;
  18. struct CBlockTemplate
  19. {
  20. CBlock block;
  21. std::vector<CAmount> vTxFees;
  22. std::vector<int64_t> vTxSigOps;
  23. };
  24. /** Run the miner threads */
  25. void GenerateBitcoins(bool fGenerate, int nThreads, const CChainParams& chainparams);
  26. /** Generate a new block, without valid proof-of-work */
  27. CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& scriptPubKeyIn);
  28. /** Modify the extranonce in a block */
  29. void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
  30. int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
  31. #endif // BITCOIN_MINER_H