diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-10-31 13:19:03 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-10-31 13:48:00 +0200 |
commit | 7986faf2e09ea85b1d4564ce910f07a4c4de8685 (patch) | |
tree | 8cdc685b210e52950a0870cfddf2bd47303d992f /src/wallet/test | |
parent | 7efc628539573af4b4a76d93b853cc46e9e52eae (diff) |
test: Fix segfault in the psbt_wallet_tests/psbt_updater_test
The bug was introduced in dcd6eeb64adb2b532f5003cbb86ba65b3c08a87b.
Diffstat (limited to 'src/wallet/test')
-rw-r--r-- | src/wallet/test/wallet_test_fixture.cpp | 7 | ||||
-rw-r--r-- | src/wallet/test/wallet_test_fixture.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/test/wallet_test_fixture.cpp b/src/wallet/test/wallet_test_fixture.cpp index fc744ebe5b..313606cc28 100644 --- a/src/wallet/test/wallet_test_fixture.cpp +++ b/src/wallet/test/wallet_test_fixture.cpp @@ -4,6 +4,8 @@ #include <wallet/test/wallet_test_fixture.h> +#include <scheduler.h> + WalletTestingSetup::WalletTestingSetup(const std::string& chainName) : TestingSetup(chainName), 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_wallet_client->registerRpcs(); } + +WalletTestingSetup::~WalletTestingSetup() +{ + if (m_node.scheduler) m_node.scheduler->stop(); +} diff --git a/src/wallet/test/wallet_test_fixture.h b/src/wallet/test/wallet_test_fixture.h index ab7fb8c42b..8bf2d36227 100644 --- a/src/wallet/test/wallet_test_fixture.h +++ b/src/wallet/test/wallet_test_fixture.h @@ -19,6 +19,7 @@ */ struct WalletTestingSetup : public TestingSetup { 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)); CWallet m_wallet; |