Rename Chain getLocator -> getTipLocator

Suggested https://github.com/bitcoin/bitcoin/pull/14711#discussion_r252044389
This commit is contained in:
Russell Yanofsky 2019-02-01 16:17:43 -05:00
parent 2c1fbaa771
commit aebafd0edf
3 changed files with 4 additions and 4 deletions

View file

@ -123,7 +123,7 @@ class LockImpl : public Chain::Lock
CBlockIndex* block = LookupBlockIndex(hash); CBlockIndex* block = LookupBlockIndex(hash);
return block && block->GetAncestor(::chainActive.Height()) == ::chainActive.Tip(); return block && block->GetAncestor(::chainActive.Height()) == ::chainActive.Tip();
} }
CBlockLocator getLocator() override { return ::chainActive.GetLocator(); } CBlockLocator getTipLocator() override { return ::chainActive.GetLocator(); }
Optional<int> findLocatorFork(const CBlockLocator& locator) override Optional<int> findLocatorFork(const CBlockLocator& locator) override
{ {
LockAnnotation lock(::cs_main); LockAnnotation lock(::cs_main);

View file

@ -96,7 +96,7 @@ public:
virtual bool isPotentialTip(const uint256& hash) = 0; virtual bool isPotentialTip(const uint256& hash) = 0;
//! Get locator for the current chain tip. //! Get locator for the current chain tip.
virtual CBlockLocator getLocator() = 0; virtual CBlockLocator getTipLocator() = 0;
//! Return height of the latest block common to locator and chain, which //! Return height of the latest block common to locator and chain, which
//! is guaranteed to be an ancestor of the block used to create the //! is guaranteed to be an ancestor of the block used to create the

View file

@ -4086,7 +4086,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
} }
auto locked_chain = chain.assumeLocked(); // Temporary. Removed in upcoming lock cleanup auto locked_chain = chain.assumeLocked(); // Temporary. Removed in upcoming lock cleanup
walletInstance->ChainStateFlushed(locked_chain->getLocator()); walletInstance->ChainStateFlushed(locked_chain->getTipLocator());
} else if (wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS) { } else if (wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS) {
// Make it impossible to disable private keys after creation // Make it impossible to disable private keys after creation
InitError(strprintf(_("Error loading %s: Private keys can only be disabled during creation"), walletFile)); 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,
} }
} }
walletInstance->WalletLogPrintf("Rescan completed in %15dms\n", GetTimeMillis() - nStart); walletInstance->WalletLogPrintf("Rescan completed in %15dms\n", GetTimeMillis() - nStart);
walletInstance->ChainStateFlushed(locked_chain->getLocator()); walletInstance->ChainStateFlushed(locked_chain->getTipLocator());
walletInstance->database->IncrementUpdateCounter(); walletInstance->database->IncrementUpdateCounter();
// Restore wallet transaction metadata after -zapwallettxes=1 // Restore wallet transaction metadata after -zapwallettxes=1