MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / GetBlockHeader

Function GetBlockHeader

src/persistence/block.cpp:205–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205bool GetBlockHeader(CBlockIndex *pBlockIndex, CBlockHeader &header) {
206 // TODO: need to use map pool of block header?
207 CDiskBlockIndex diskBlockIndex;
208 if (!pCdMan->pBlockIndexDb->GetBlockIndex(pBlockIndex->GetBlockHash(), diskBlockIndex)) {
209 return ERRORMSG("the index of block=%s not found in db", pBlockIndex->GetIdString());
210 }
211 diskBlockIndex.GetBlockHeader(header);
212 return true;
213}

Callers 1

ProcessGetHeadersMessageFunction · 0.85

Calls 4

GetBlockIndexMethod · 0.80
GetIdStringMethod · 0.80
GetBlockHashMethod · 0.45
GetBlockHeaderMethod · 0.45

Tested by

no test coverage detected