MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / MakeBlockInfo

Function MakeBlockInfo

src/kernel/chain.cpp:18–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17namespace kernel {
18interfaces::BlockInfo MakeBlockInfo(const CBlockIndex* index, const CBlock* data)
19{
20 interfaces::BlockInfo info{index ? *index->phashBlock : uint256::ZERO};
21 if (index) {
22 info.prev_hash = index->pprev ? index->pprev->phashBlock : nullptr;
23 info.height = index->nHeight;
24 info.chain_time_max = index->GetBlockTimeMax();
25 LOCK(::cs_main);
26 info.file_number = index->nFile;
27 info.data_pos = index->nDataPos;
28 }
29 info.data = data;
30 return info;
31}
32
33std::ostream& operator<<(std::ostream& os, const ChainstateRole& role) {
34 if (!role.validated) {

Callers 5

ProcessBlockMethod · 0.85
RewindMethod · 0.85
generateFakeBlockFunction · 0.85
BlockConnectedMethod · 0.85
BlockDisconnectedMethod · 0.85

Calls 1

GetBlockTimeMaxMethod · 0.80

Tested by

no test coverage detected