| 49 | } |
| 50 | |
| 51 | const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const { |
| 52 | if (pindex == nullptr) { |
| 53 | return nullptr; |
| 54 | } |
| 55 | if (pindex->nHeight > Height()) |
| 56 | pindex = pindex->GetAncestor(Height()); |
| 57 | while (pindex && !Contains(pindex)) |
| 58 | pindex = pindex->pprev; |
| 59 | return pindex; |
| 60 | } |
| 61 | |
| 62 | CBlockIndex* CChain::FindEarliestAtLeast(int64_t nTime) const |
| 63 | { |
no test coverage detected