wallet: Rename `CWallet::GetBestBlock` to `GetPersistedBestBlock`
This more accurately reflects its meaning, as it corresponds to the most recently persisted best chain (i.e. the chain tip that the wallet will return to on restart), rather than the chain tip to which the in-memory wallet state has been synced.
This commit is contained in:
parent
3a1261efda
commit
098a70ed89
|
@ -1727,7 +1727,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||||
if (pwalletMain)
|
if (pwalletMain)
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
const auto walletBestBlock = pwalletMain->GetBestBlock();
|
const auto walletBestBlock = pwalletMain->GetPersistedBestBlock();
|
||||||
if (walletBestBlock != nullptr) {
|
if (walletBestBlock != nullptr) {
|
||||||
pindexLastTip = walletBestBlock;
|
pindexLastTip = walletBestBlock;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1501,7 +1501,7 @@ void CWallet::SetBestChain(const CBlockLocator& loc)
|
||||||
SetBestChainINTERNAL(walletdb, loc);
|
SetBestChainINTERNAL(walletdb, loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBlockIndex* CWallet::GetBestBlock()
|
CBlockIndex* CWallet::GetPersistedBestBlock()
|
||||||
{
|
{
|
||||||
AssertLockHeld(cs_main);
|
AssertLockHeld(cs_main);
|
||||||
AssertLockHeld(cs_wallet);
|
AssertLockHeld(cs_wallet);
|
||||||
|
|
|
@ -1806,11 +1806,15 @@ public:
|
||||||
/** Saves witness caches and best block locator to disk. */
|
/** Saves witness caches and best block locator to disk. */
|
||||||
void SetBestChain(const CBlockLocator& loc);
|
void SetBestChain(const CBlockLocator& loc);
|
||||||
/**
|
/**
|
||||||
* Returns the block index corresponding to the wallet's best block, or
|
* Returns the block index corresponding to the wallet's most recently
|
||||||
* nullptr if the wallet's best block is not known to this node (e.g. if the
|
* persisted best block. This is the state to which the wallet will revert
|
||||||
* wallet was transplanted from another node).
|
* if restarted immediately, and does not necessarily match the current
|
||||||
|
* in-memory state.
|
||||||
|
*
|
||||||
|
* Returns nullptr if the wallet's best block is not known to this node
|
||||||
|
* (e.g. if the wallet was transplanted from another node).
|
||||||
*/
|
*/
|
||||||
CBlockIndex* GetBestBlock();
|
CBlockIndex* GetPersistedBestBlock();
|
||||||
|
|
||||||
std::set<std::pair<libzcash::SproutPaymentAddress, uint256>> GetSproutNullifiers(
|
std::set<std::pair<libzcash::SproutPaymentAddress, uint256>> GetSproutNullifiers(
|
||||||
const std::set<libzcash::SproutPaymentAddress>& addresses);
|
const std::set<libzcash::SproutPaymentAddress>& addresses);
|
||||||
|
|
Loading…
Reference in New Issue