MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / FindEarliestAtLeast

Method FindEarliestAtLeast

src/chain.cpp:62–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62CBlockIndex* CChain::FindEarliestAtLeast(int64_t nTime) const
63{
64 std::vector<CBlockIndex*>::const_iterator lower = std::lower_bound(vChain.begin(), vChain.end(), nTime,
65 [](CBlockIndex* pBlock, const int64_t& time) -> bool { return pBlock->GetBlockTimeMax() < time; });
66 return (lower == vChain.end() ? nullptr : *lower);
67}
68
69/** Turn the lowest '1' bit in the binary representation of a number into a '0'. */
70int static inline InvertLowestOne(int n) { return n & (n - 1); }

Callers 3

RescanFromTimeMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
pruneblockchainFunction · 0.80

Calls 3

GetBlockTimeMaxMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64