mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-08 18:49:28 +08:00
refactor: Wallet stats logging in its own function
This will avoid repetition when wallet creation and loading are separated.
This commit is contained in:
@@ -3093,12 +3093,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
{
|
||||
LOCK(walletInstance->cs_wallet);
|
||||
walletInstance->WalletLogPrintf("setKeyPool.size() = %u\n", walletInstance->GetKeyPoolSize());
|
||||
walletInstance->WalletLogPrintf("mapWallet.size() = %u\n", walletInstance->mapWallet.size());
|
||||
walletInstance->WalletLogPrintf("m_address_book.size() = %u\n", walletInstance->m_address_book.size());
|
||||
}
|
||||
WITH_LOCK(walletInstance->cs_wallet, walletInstance->LogStats());
|
||||
|
||||
return walletInstance;
|
||||
}
|
||||
|
||||
@@ -940,6 +940,14 @@ public:
|
||||
LogInfo("[%s] %s", LogName(), tfm::format(wallet_fmt, params...));
|
||||
};
|
||||
|
||||
void LogStats() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
|
||||
{
|
||||
AssertLockHeld(cs_wallet);
|
||||
WalletLogPrintf("setKeyPool.size() = %u\n", GetKeyPoolSize());
|
||||
WalletLogPrintf("mapWallet.size() = %u\n", mapWallet.size());
|
||||
WalletLogPrintf("m_address_book.size() = %u\n", m_address_book.size());
|
||||
};
|
||||
|
||||
//! Returns all unique ScriptPubKeyMans in m_internal_spk_managers and m_external_spk_managers
|
||||
std::set<ScriptPubKeyMan*> GetActiveScriptPubKeyMans() const;
|
||||
bool IsActiveScriptPubKeyMan(const ScriptPubKeyMan& spkm) const;
|
||||
|
||||
Reference in New Issue
Block a user