Skip to content

Commit aebafd0

Browse files
committed
Rename Chain getLocator -> getTipLocator
Suggested bitcoin/bitcoin#14711 (comment)
1 parent 2c1fbaa commit aebafd0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/interfaces/chain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class LockImpl : public Chain::Lock
123123
CBlockIndex* block = LookupBlockIndex(hash);
124124
return block && block->GetAncestor(::chainActive.Height()) == ::chainActive.Tip();
125125
}
126-
CBlockLocator getLocator() override { return ::chainActive.GetLocator(); }
126+
CBlockLocator getTipLocator() override { return ::chainActive.GetLocator(); }
127127
Optional<int> findLocatorFork(const CBlockLocator& locator) override
128128
{
129129
LockAnnotation lock(::cs_main);

src/interfaces/chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class Chain
9696
virtual bool isPotentialTip(const uint256& hash) = 0;
9797

9898
//! Get locator for the current chain tip.
99-
virtual CBlockLocator getLocator() = 0;
99+
virtual CBlockLocator getTipLocator() = 0;
100100

101101
//! Return height of the latest block common to locator and chain, which
102102
//! is guaranteed to be an ancestor of the block used to create the

src/wallet/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4086,7 +4086,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
40864086
}
40874087

40884088
auto locked_chain = chain.assumeLocked(); // Temporary. Removed in upcoming lock cleanup
4089-
walletInstance->ChainStateFlushed(locked_chain->getLocator());
4089+
walletInstance->ChainStateFlushed(locked_chain->getTipLocator());
40904090
} else if (wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS) {
40914091
// Make it impossible to disable private keys after creation
40924092
InitError(strprintf(_("Error loading %s: Private keys can only be disabled during creation"), walletFile));
@@ -4233,7 +4233,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
42334233
}
42344234
}
42354235
walletInstance->WalletLogPrintf("Rescan completed in %15dms\n", GetTimeMillis() - nStart);
4236-
walletInstance->ChainStateFlushed(locked_chain->getLocator());
4236+
walletInstance->ChainStateFlushed(locked_chain->getTipLocator());
42374237
walletInstance->database->IncrementUpdateCounter();
42384238

42394239
// Restore wallet transaction metadata after -zapwallettxes=1

0 commit comments

Comments
 (0)