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.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2009-2010 Satoshi Nakamoto
  2. // Copyright (c) 2009-2013 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 CReserveKey;
  11. class CScript;
  12. class CWallet;
  13. struct CBlockTemplate
  14. {
  15. CBlock block;
  16. std::vector<CAmount> vTxFees;
  17. std::vector<int64_t> vTxSigOps;
  18. };
  19. /** Run the miner threads */
  20. void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
  21. /** Create a single block */
  22. bool MineBlock(CWallet *pwallet, uint256& hash);
  23. /** Generate a new block, without valid proof-of-work */
  24. CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CBlockIndex*& pindexPrev);
  25. CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey, CBlockIndex*& pindexPrev);
  26. /** Modify the extranonce in a block */
  27. void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
  28. void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev);
  29. #endif // BITCOIN_MINER_H