interfaces, chain, refactor: Remove inaccurate getActiveChainLocator

The getActiveChainLocator method name was misleading, and its functionality
duplicated `Chain::findBlock`. This commit removes the method and replaces
all its usages with direct `Chain::findBlock` calls.

Additionally, the comment of getActiveChainLocator has been outdated since
commit ed47094 from #25717.

Finally, in CWallet::ScanForWalletTransactions, the findBlock calls are now
unified into a single call at the start of the function.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
Co-authored-by: Matias Furszyfer <mfurszy@protonmail.com>
This commit is contained in:
pablomartin4btc
2025-08-10 15:24:49 -03:00
parent 110a0f405c
commit 2b00030af8
3 changed files with 10 additions and 20 deletions

View File

@@ -559,12 +559,6 @@ public:
const CBlockIndex* block{chainman().ActiveChain()[height]};
return block && ((block->nStatus & BLOCK_HAVE_DATA) != 0) && block->nTx > 0;
}
CBlockLocator getActiveChainLocator(const uint256& block_hash) override
{
LOCK(::cs_main);
const CBlockIndex* index = chainman().m_blockman.LookupBlockIndex(block_hash);
return GetLocator(index);
}
std::optional<int> findLocatorFork(const CBlockLocator& locator) override
{
LOCK(::cs_main);