Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
mining.h File Reference
#include <node/miner.h>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for mining.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  node

Functions

std::vector< std::shared_ptr< CBlock > > CreateBlockChain (size_t total_height, const CChainParams &params)
 Create a blockchain, starting from genesis.
COutPoint MineBlock (const node::NodeContext &, const node::BlockAssembler::Options &assembler_options)
 Returns the generated coin.
COutPoint MineBlock (const node::NodeContext &, std::shared_ptr< CBlock > &block)
 Returns the generated coin (or Null if the block was invalid).
COutPoint ProcessBlock (const node::NodeContext &, const std::shared_ptr< CBlock > &block)
 Returns the generated coin (or Null if the block was invalid).
std::shared_ptr< CBlockPrepareBlock (const node::NodeContext &)
 Prepare a block to be mined.
std::shared_ptr< CBlockPrepareBlock (const node::NodeContext &node, const node::BlockAssembler::Options &assembler_options)
COutPoint generatetoaddress (const node::NodeContext &, const std::string &address)
 RPC-like helper function, returns the generated coin.

Function Documentation

◆ CreateBlockChain()

std::vector< std::shared_ptr< CBlock > > CreateBlockChain ( size_t total_height,
const CChainParams & params )

Create a blockchain, starting from genesis.

Definition at line 37 of file mining.cpp.

Here is the call graph for this function:

◆ generatetoaddress()

COutPoint generatetoaddress ( const node::NodeContext & node,
const std::string & address )

RPC-like helper function, returns the generated coin.

Definition at line 26 of file mining.cpp.

Here is the call graph for this function:

◆ MineBlock() [1/2]

COutPoint MineBlock ( const node::NodeContext & node,
const node::BlockAssembler::Options & assembler_options )

Returns the generated coin.

Definition at line 72 of file mining.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MineBlock() [2/2]

COutPoint MineBlock ( const node::NodeContext & node,
std::shared_ptr< CBlock > & block )

Returns the generated coin (or Null if the block was invalid).

It is recommended to call RegenerateCommitments before mining the block to avoid merkle tree mismatches.

Definition at line 96 of file mining.cpp.

Here is the call graph for this function:

◆ PrepareBlock() [1/2]

std::shared_ptr< CBlock > PrepareBlock ( const node::NodeContext & )

Prepare a block to be mined.

◆ PrepareBlock() [2/2]

std::shared_ptr< CBlock > PrepareBlock ( const node::NodeContext & node,
const node::BlockAssembler::Options & assembler_options )

◆ ProcessBlock()

COutPoint ProcessBlock ( const node::NodeContext & node,
const std::shared_ptr< CBlock > & block )

Returns the generated coin (or Null if the block was invalid).

Definition at line 106 of file mining.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: