Bitcoin Core 28.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
mining.h
Go to the documentation of this file.
1// Copyright (c) 2019-2021 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 <node/miner.h>
9
10#include <memory>
11#include <string>
12#include <vector>
13
14class CBlock;
15class CChainParams;
16class COutPoint;
17class CScript;
18namespace node {
19struct NodeContext;
20} // namespace node
21
23std::vector<std::shared_ptr<CBlock>> CreateBlockChain(size_t total_height, const CChainParams& params);
24
26COutPoint MineBlock(const node::NodeContext&, const CScript& coinbase_scriptPubKey);
27
32COutPoint MineBlock(const node::NodeContext&, std::shared_ptr<CBlock>& block);
33
35std::shared_ptr<CBlock> PrepareBlock(const node::NodeContext&, const CScript& coinbase_scriptPubKey);
36std::shared_ptr<CBlock> PrepareBlock(const node::NodeContext& node, const CScript& coinbase_scriptPubKey,
37 const node::BlockAssembler::Options& assembler_options);
38
40COutPoint generatetoaddress(const node::NodeContext&, const std::string& address);
41
42#endif // BITCOIN_TEST_UTIL_MINING_H
Definition block.h:69
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition chainparams.h:81
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition transaction.h:29
Serialized script, used inside transaction inputs and outputs.
Definition script.h:414
static RPCHelpMan generatetoaddress()
Definition mining.cpp:260
NodeContext struct containing references to chain state and connection state.
Definition context.h:55
std::shared_ptr< CBlock > PrepareBlock(const node::NodeContext &, const CScript &coinbase_scriptPubKey)
Prepare a block to be mined.
Definition mining.cpp:125
COutPoint MineBlock(const node::NodeContext &, const CScript &coinbase_scriptPubKey)
Returns the generated coin.
Definition mining.cpp:63
std::vector< std::shared_ptr< CBlock > > CreateBlockChain(size_t total_height, const CChainParams &params)
Create a blockchain, starting from genesis.
Definition mining.cpp:32