mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 21:52:53 +02:00
Change CChain::FindFork() to take ref
The internal null-guard in FindFork() was removed in favor of adding any missing guards at call sites.
This commit is contained in:
@@ -47,10 +47,9 @@ CBlockLocator GetLocator(const CBlockIndex* index)
|
||||
return CBlockLocator{LocatorEntries(index)};
|
||||
}
|
||||
|
||||
const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
|
||||
if (pindex == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
const CBlockIndex* CChain::FindFork(const CBlockIndex& index) const
|
||||
{
|
||||
const auto* pindex{&index};
|
||||
if (pindex->nHeight > Height())
|
||||
pindex = pindex->GetAncestor(Height());
|
||||
while (pindex && !Contains(*pindex))
|
||||
|
||||
Reference in New Issue
Block a user