Bitcoin Core 30.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | Private Member Functions | List of all members
HeadersGeneratorSetup Struct Reference
Inheritance diagram for HeadersGeneratorSetup:
[legend]
Collaboration diagram for HeadersGeneratorSetup:
[legend]

Public Member Functions

const std::vector< CBlockHeader > & FirstChain ()
 
const std::vector< CBlockHeader > & SecondChain ()
 
HeadersSyncState CreateState ()
 
- Public Member Functions inherited from RegTestingSetup
 RegTestingSetup ()
 
- Public Member Functions inherited from TestingSetup
 TestingSetup (const ChainType chainType=ChainType::MAIN, TestOpts={})
 
- Public Member Functions inherited from ChainTestingSetup
 ChainTestingSetup (const ChainType chainType=ChainType::MAIN, TestOpts={})
 
 ~ChainTestingSetup ()
 
void LoadVerifyActivateChainstate ()
 
- Public Member Functions inherited from BasicTestingSetup
void SeedRandomForTest (SeedRand seed)
 Seed the global RNG state and m_rng for testing and log the seed value. More...
 
 BasicTestingSetup (const ChainType chainType=ChainType::MAIN, TestOpts={})
 
 ~BasicTestingSetup ()
 

Public Attributes

const CBlockgenesis {Params().GenesisBlock()}
 
const CBlockIndexchain_start {WITH_LOCK(::cs_main, return m_node.chainman->m_blockman.LookupBlockIndex(genesis.GetHash()))}
 
- Public Attributes inherited from ChainTestingSetup
kernel::CacheSizes m_kernel_cache_sizes {node::CalculateCacheSizes(m_args).kernel}
 
bool m_coins_db_in_memory {true}
 
bool m_block_tree_db_in_memory {true}
 
std::function< void()> m_make_chainman {}
 
- Public Attributes inherited from BasicTestingSetup
util::SignalInterrupt m_interrupt
 
node::NodeContext m_node
 
FastRandomContext m_rng
 
fs::path m_path_root
 
fs::path m_path_lock
 
bool m_has_custom_datadir {false}
 
ArgsManager m_args
 Test-specific arguments and settings. More...
 

Private Member Functions

void FindProofOfWork (CBlockHeader &starting_header)
 Search for a nonce to meet (regtest) proof of work. More...
 
std::vector< CBlockHeaderGenerateHeaders (size_t count, uint256 prev_hash, int32_t nVersion, uint32_t prev_time, const uint256 &merkle_root, uint32_t nBits)
 Generate headers in a chain that build off a given starting hash, using the given nVersion, advancing time by 1 second from the starting prev_time, and with a fixed merkle root hash. More...
 

Detailed Description

Definition at line 53 of file headers_sync_chainwork_tests.cpp.

Member Function Documentation

◆ CreateState()

HeadersSyncState HeadersGeneratorSetup::CreateState ( )
inline

Definition at line 81 of file headers_sync_chainwork_tests.cpp.

Here is the call graph for this function:

◆ FindProofOfWork()

void HeadersGeneratorSetup::FindProofOfWork ( CBlockHeader starting_header)
private

Search for a nonce to meet (regtest) proof of work.

Definition at line 106 of file headers_sync_chainwork_tests.cpp.

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

◆ FirstChain()

const std::vector< CBlockHeader > & HeadersGeneratorSetup::FirstChain ( )
inline

Definition at line 59 of file headers_sync_chainwork_tests.cpp.

Here is the call graph for this function:

◆ GenerateHeaders()

std::vector< CBlockHeader > HeadersGeneratorSetup::GenerateHeaders ( size_t  count,
uint256  prev_hash,
int32_t  nVersion,
uint32_t  prev_time,
const uint256 merkle_root,
uint32_t  nBits 
)
private

Generate headers in a chain that build off a given starting hash, using the given nVersion, advancing time by 1 second from the starting prev_time, and with a fixed merkle root hash.

Definition at line 113 of file headers_sync_chainwork_tests.cpp.

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

◆ SecondChain()

const std::vector< CBlockHeader > & HeadersGeneratorSetup::SecondChain ( )
inline

Definition at line 73 of file headers_sync_chainwork_tests.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ chain_start

const CBlockIndex* HeadersGeneratorSetup::chain_start {WITH_LOCK(::cs_main, return m_node.chainman->m_blockman.LookupBlockIndex(genesis.GetHash()))}

Definition at line 55 of file headers_sync_chainwork_tests.cpp.

◆ genesis

const CBlock& HeadersGeneratorSetup::genesis {Params().GenesisBlock()}

Definition at line 54 of file headers_sync_chainwork_tests.cpp.


The documentation for this struct was generated from the following file: