aboutsummaryrefslogtreecommitdiff
path: root/src/chain.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2017-01-13 15:48:28 -0800
committerPieter Wuille <[email protected]>2017-01-13 16:06:05 -0800
commite126d0c12ca66278d9e7b12187c5ff4fc02a7e6c (patch)
treeffbb05a46f5727d1a6f653682288af9600869938 /src/chain.cpp
parentMerge #9375: Relay compact block messages prior to full block connection (diff)
parentAdd unit test for FindEarliestAtLeast (diff)
downloaddiscoin-e126d0c12ca66278d9e7b12187c5ff4fc02a7e6c.tar.xz
discoin-e126d0c12ca66278d9e7b12187c5ff4fc02a7e6c.zip
Merge #9490: Replace FindLatestBefore used by importmuti with FindEarliestAtLeast.
4b06e41 Add unit test for FindEarliestAtLeast (Suhas Daftuar) 997a98a Replace FindLatestBefore used by importmuti with FindEarliestAtLeast. (Gregory Maxwell)
Diffstat (limited to 'src/chain.cpp')
-rw-r--r--src/chain.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/chain.cpp b/src/chain.cpp
index 3cd7b3392..0f4d422b9 100644
--- a/src/chain.cpp
+++ b/src/chain.cpp
@@ -61,10 +61,10 @@ const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
return pindex;
}
-CBlockIndex* CChain::FindLatestBefore(int64_t nTime) const
+CBlockIndex* CChain::FindEarliestAtLeast(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; });
+ [](CBlockIndex* pBlock, const int64_t& time) -> bool { return pBlock->GetBlockTimeMax() < time; });
return (lower == vChain.end() ? NULL : *lower);
}