Bitcoin Core  22.99.0
P2P Digital Currency
mining.h
Go to the documentation of this file.
1 // Copyright (c) 2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_TEST_UTIL_MINING_H
6 #define BITCOIN_TEST_UTIL_MINING_H
7 
8 #include <memory>
9 #include <string>
10 #include <vector>
11 
12 class CBlock;
13 class CChainParams;
14 class CScript;
15 class CTxIn;
16 struct NodeContext;
17 
19 std::vector<std::shared_ptr<CBlock>> CreateBlockChain(size_t total_height, const CChainParams& params);
20 
22 CTxIn MineBlock(const NodeContext&, const CScript& coinbase_scriptPubKey);
23 
25 std::shared_ptr<CBlock> PrepareBlock(const NodeContext&, const CScript& coinbase_scriptPubKey);
26 
28 CTxIn generatetoaddress(const NodeContext&, const std::string& address);
29 
30 #endif // BITCOIN_TEST_UTIL_MINING_H
CTxIn
An input of a transaction.
Definition: transaction.h:65
MineBlock
CTxIn MineBlock(const NodeContext &, const CScript &coinbase_scriptPubKey)
Returns the generated coin.
Definition: mining.cpp:59
CChainParams
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition: chainparams.h:69
PrepareBlock
std::shared_ptr< CBlock > PrepareBlock(const NodeContext &, const CScript &coinbase_scriptPubKey)
Prepare a block to be mined.
Definition: mining.cpp:74
CScript
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:405
generatetoaddress
CTxIn generatetoaddress(const NodeContext &, const std::string &address)
RPC-like helper function, returns the generated coin.
Definition: mining.cpp:19
CBlock
Definition: block.h:62
CreateBlockChain
std::vector< std::shared_ptr< CBlock > > CreateBlockChain(size_t total_height, const CChainParams &params)
Create a blockchain, starting from genesis.
Definition: mining.cpp:28
NodeContext
NodeContext struct containing references to chain state and connection state.
Definition: context.h:39