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

Function GetOrphanRoot

src/main.cpp:358–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358uint256 GetOrphanRoot(const uint256 &hash) {
359 map<uint256, COrphanBlock *>::iterator it = mapOrphanBlocks.find(hash);
360 if (it == mapOrphanBlocks.end())
361 return hash;
362
363 // Work back to the first block in the orphan chain
364 do {
365 map<uint256, COrphanBlock *>::iterator it2 = mapOrphanBlocks.find(it->second->prevBlockHash);
366 if (it2 == mapOrphanBlocks.end())
367 return it->first;
368 it = it2;
369 } while (true);
370}
371
372// Remove a random orphan block (which does not have any dependent orphans).
373bool static PruneOrphanBlocks(int32_t height) {

Callers 2

ProcessBlockFunction · 0.85
ProcessInvMessageFunction · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected