mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 13:49:35 +02:00
test: Fix segfault in the psbt_wallet_tests/psbt_updater_test
The bug was introduced in dcd6eeb64a.
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include <wallet/test/wallet_test_fixture.h>
|
#include <wallet/test/wallet_test_fixture.h>
|
||||||
|
|
||||||
|
#include <scheduler.h>
|
||||||
|
|
||||||
WalletTestingSetup::WalletTestingSetup(const std::string& chainName)
|
WalletTestingSetup::WalletTestingSetup(const std::string& chainName)
|
||||||
: TestingSetup(chainName),
|
: TestingSetup(chainName),
|
||||||
m_wallet(m_node.chain.get(), "", CreateMockWalletDatabase())
|
m_wallet(m_node.chain.get(), "", CreateMockWalletDatabase())
|
||||||
@@ -12,3 +14,8 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName)
|
|||||||
m_chain_notifications_handler = m_node.chain->handleNotifications({ &m_wallet, [](CWallet*) {} });
|
m_chain_notifications_handler = m_node.chain->handleNotifications({ &m_wallet, [](CWallet*) {} });
|
||||||
m_wallet_client->registerRpcs();
|
m_wallet_client->registerRpcs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WalletTestingSetup::~WalletTestingSetup()
|
||||||
|
{
|
||||||
|
if (m_node.scheduler) m_node.scheduler->stop();
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
struct WalletTestingSetup : public TestingSetup {
|
struct WalletTestingSetup : public TestingSetup {
|
||||||
explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
||||||
|
~WalletTestingSetup();
|
||||||
|
|
||||||
std::unique_ptr<interfaces::WalletClient> m_wallet_client = interfaces::MakeWalletClient(*m_node.chain, *Assert(m_node.args));
|
std::unique_ptr<interfaces::WalletClient> m_wallet_client = interfaces::MakeWalletClient(*m_node.chain, *Assert(m_node.args));
|
||||||
CWallet m_wallet;
|
CWallet m_wallet;
|
||||||
|
|||||||
Reference in New Issue
Block a user