mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-25 06:55:32 +01:00
Add importmulti rpc call
This commit is contained in:
@@ -61,6 +61,13 @@ const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
|
||||
return pindex;
|
||||
}
|
||||
|
||||
CBlockIndex* CChain::FindLatestBefore(int64_t nTime) const
|
||||
{
|
||||
std::vector<CBlockIndex*>::const_iterator lower = std::lower_bound(vChain.begin(), vChain.end(), nTime,
|
||||
[](CBlockIndex* pBlock, const int64_t& time) -> bool { return pBlock->GetBlockTime() < time; });
|
||||
return (lower == vChain.end() ? NULL : *lower);
|
||||
}
|
||||
|
||||
/** Turn the lowest '1' bit in the binary representation of a number into a '0'. */
|
||||
int static inline InvertLowestOne(int n) { return n & (n - 1); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user