diff options
| author | Pieter Wuille <[email protected]> | 2017-01-13 15:48:28 -0800 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-01-13 16:06:05 -0800 |
| commit | e126d0c12ca66278d9e7b12187c5ff4fc02a7e6c (patch) | |
| tree | ffbb05a46f5727d1a6f653682288af9600869938 /src/chain.cpp | |
| parent | Merge #9375: Relay compact block messages prior to full block connection (diff) | |
| parent | Add unit test for FindEarliestAtLeast (diff) | |
| download | discoin-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.cpp | 4 |
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); } |