Bitcoin Core
31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
src
test
util
mining.h
Go to the documentation of this file.
1
// Copyright (c) 2019-present 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
14
class
CBlock
;
15
class
CChainParams
;
16
class
COutPoint
;
17
class
CScript
;
18
namespace
node
{
19
struct
NodeContext;
20
}
// namespace node
21
23
std::vector<std::shared_ptr<CBlock>>
CreateBlockChain
(
size_t
total_height
,
const
CChainParams
& params);
24
26
COutPoint
MineBlock
(
const
node::NodeContext
&,
27
const
node::BlockAssembler::Options
&
assembler_options
);
28
33
COutPoint
MineBlock
(
const
node::NodeContext
&, std::shared_ptr<CBlock>& block);
34
38
COutPoint
ProcessBlock
(
const
node::NodeContext
&,
const
std::shared_ptr<CBlock>& block);
39
41
std::shared_ptr<CBlock>
PrepareBlock
(
const
node::NodeContext
&);
42
std::shared_ptr<CBlock>
PrepareBlock
(
const
node::NodeContext
&
node
,
43
const
node::BlockAssembler::Options
&
assembler_options
);
44
46
COutPoint
generatetoaddress
(
const
node::NodeContext
&,
const
std::string& address);
47
48
#endif
// BITCOIN_TEST_UTIL_MINING_H
CBlock
Definition
block.h:74
CChainParams
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition
chainparams.h:77
COutPoint
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition
transaction.h:29
CScript
Serialized script, used inside transaction inputs and outputs.
Definition
script.h:405
miner.h
node
Definition
messages.h:21
generatetoaddress
static RPCHelpMan generatetoaddress()
Definition
mining.cpp:264
node::BlockAssembler::Options
Definition
miner.h:81
node::NodeContext
NodeContext struct containing references to chain state and connection state.
Definition
context.h:56
ProcessBlock
COutPoint ProcessBlock(const node::NodeContext &, const std::shared_ptr< CBlock > &block)
Returns the generated coin (or Null if the block was invalid).
Definition
mining.cpp:106
MineBlock
COutPoint MineBlock(const node::NodeContext &, const node::BlockAssembler::Options &assembler_options)
Returns the generated coin.
Definition
mining.cpp:72
PrepareBlock
std::shared_ptr< CBlock > PrepareBlock(const node::NodeContext &)
Prepare a block to be mined.
CreateBlockChain
std::vector< std::shared_ptr< CBlock > > CreateBlockChain(size_t total_height, const CChainParams ¶ms)
Create a blockchain, starting from genesis.
Definition
mining.cpp:37
Ticks
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition
time.h:73
Generated on Thu Apr 16 2026 09:42:38 for Bitcoin Core by
1.10.0