MCPcopy Create free account
hub / github.com/ElementsProject/elements / FillBlock

Function FillBlock

src/node/interfaces.cpp:346–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344};
345
346bool FillBlock(const CBlockIndex* index, const FoundBlock& block, UniqueLock<RecursiveMutex>& lock, const CChain& active)
347{
348 if (!index) return false;
349 if (block.m_hash) *block.m_hash = index->GetBlockHash();
350 if (block.m_height) *block.m_height = index->nHeight;
351 if (block.m_time) *block.m_time = index->GetBlockTime();
352 if (block.m_max_time) *block.m_max_time = index->GetBlockTimeMax();
353 if (block.m_mtp_time) *block.m_mtp_time = index->GetMedianTimePast();
354 if (block.m_in_active_chain) *block.m_in_active_chain = active[index->nHeight] == index;
355 if (block.m_next_block) FillBlock(active[index->nHeight] == index ? active[index->nHeight + 1] : nullptr, *block.m_next_block, lock, active);
356 if (block.m_data) {
357 REVERSE_LOCK(lock);
358 if (!ReadBlockFromDisk(*block.m_data, index, Params().GetConsensus())) block.m_data->SetNull();
359 }
360 block.found = true;
361 return true;
362}
363
364class NotificationsProxy : public CValidationInterface
365{

Callers 5

findBlockMethod · 0.85
findAncestorByHeightMethod · 0.85
findAncestorByHashMethod · 0.85
findCommonAncestorMethod · 0.85

Calls 7

ReadBlockFromDiskFunction · 0.85
GetBlockTimeMaxMethod · 0.80
GetMedianTimePastMethod · 0.80
ParamsClass · 0.70
GetBlockHashMethod · 0.45
GetBlockTimeMethod · 0.45
SetNullMethod · 0.45

Tested by

no test coverage detected