mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-28 16:36:04 +01:00
wallet: Remove unnecessary database Close step on shutdown
StopWallets, which was being called prior to UnloadWallets, performs an unnecessary database closing step. This causes issues in UnloadWallets which does additional database cleanups. Since the database closing step is unnecessary, StopWallets is removed, and UnloadWallets is now called from WalletLoaderImpl::stop.
This commit is contained in:
@@ -553,7 +553,7 @@ public:
|
||||
m_context.chain = &chain;
|
||||
m_context.args = &args;
|
||||
}
|
||||
~WalletLoaderImpl() override { UnloadWallets(m_context); }
|
||||
~WalletLoaderImpl() override { stop(); }
|
||||
|
||||
//! ChainClient methods
|
||||
void registerRpcs() override
|
||||
@@ -574,7 +574,7 @@ public:
|
||||
m_context.scheduler = &scheduler;
|
||||
return StartWallets(m_context);
|
||||
}
|
||||
void stop() override { return StopWallets(m_context); }
|
||||
void stop() override { return UnloadWallets(m_context); }
|
||||
void setMockTime(int64_t time) override { return SetMockTime(time); }
|
||||
void schedulerMockForward(std::chrono::seconds delta) override { Assert(m_context.scheduler)->MockForward(delta); }
|
||||
|
||||
|
||||
@@ -162,13 +162,6 @@ void StartWallets(WalletContext& context)
|
||||
context.scheduler->scheduleEvery([&context] { MaybeResendWalletTxs(context); }, 1min);
|
||||
}
|
||||
|
||||
void StopWallets(WalletContext& context)
|
||||
{
|
||||
for (const std::shared_ptr<CWallet>& pwallet : GetWallets(context)) {
|
||||
pwallet->Close();
|
||||
}
|
||||
}
|
||||
|
||||
void UnloadWallets(WalletContext& context)
|
||||
{
|
||||
auto wallets = GetWallets(context);
|
||||
|
||||
@@ -28,10 +28,6 @@ bool LoadWallets(WalletContext& context);
|
||||
//! Complete startup of wallets.
|
||||
void StartWallets(WalletContext& context);
|
||||
|
||||
//! Stop all wallets. Wallets will be flushed first.
|
||||
void StopWallets(WalletContext& context);
|
||||
|
||||
//! Close all wallets.
|
||||
void UnloadWallets(WalletContext& context);
|
||||
} // namespace wallet
|
||||
|
||||
|
||||
Reference in New Issue
Block a user