mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 17:56:16 +00:00
wallet: Delete unnecessary PopulateWalletFromDB() calls
This commit is contained in:
parent
f0a046094e
commit
0972785fd7
@ -77,7 +77,6 @@ void TestAddAddressesToSendBook(interfaces::Node& node)
|
||||
test.m_node.wallet_loader = wallet_loader.get();
|
||||
node.setContext(&test.m_node);
|
||||
const std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(node.context()->chain.get(), "", CreateMockableWalletDatabase());
|
||||
wallet->PopulateWalletFromDB();
|
||||
wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
|
||||
{
|
||||
LOCK(wallet->cs_wallet);
|
||||
|
||||
@ -192,7 +192,6 @@ void SyncUpWallet(const std::shared_ptr<CWallet>& wallet, interfaces::Node& node
|
||||
std::shared_ptr<CWallet> SetupDescriptorsWallet(interfaces::Node& node, TestChain100Setup& test, bool watch_only = false)
|
||||
{
|
||||
std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(node.context()->chain.get(), "", CreateMockableWalletDatabase());
|
||||
wallet->PopulateWalletFromDB();
|
||||
LOCK(wallet->cs_wallet);
|
||||
wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
|
||||
if (watch_only) {
|
||||
|
||||
@ -198,13 +198,6 @@ bool CreateFromDump(const ArgsManager& args, const std::string& name, const fs::
|
||||
bool ret = true;
|
||||
std::shared_ptr<CWallet> wallet(new CWallet(/*chain=*/nullptr, name, std::move(database)), WalletToolReleaseWallet);
|
||||
{
|
||||
LOCK(wallet->cs_wallet);
|
||||
DBErrors load_wallet_ret = wallet->PopulateWalletFromDB();
|
||||
if (load_wallet_ret != DBErrors::LOAD_OK) {
|
||||
error = strprintf(_("Error creating %s"), name);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the database handle
|
||||
WalletDatabase& db = wallet->GetDatabase();
|
||||
std::unique_ptr<DatabaseBatch> batch = db.MakeBatch();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user