From 52153d9849b14cb9e8491886b4aeaf4004520aa2 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 13 Dec 2023 02:53:01 +0700 Subject: [PATCH] refactor: assert of masternodeSync existance moved from wallet to coinjoin --- src/coinjoin/client.cpp | 1 + src/wallet/wallet.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coinjoin/client.cpp b/src/coinjoin/client.cpp index 35d6f9da44..a8638c7ce3 100644 --- a/src/coinjoin/client.cpp +++ b/src/coinjoin/client.cpp @@ -1891,6 +1891,7 @@ void CCoinJoinClientManager::GetJsonInfo(UniValue& obj) const } void CJClientManager::Add(CWallet& wallet) { + assert(::masternodeSync != nullptr); m_wallet_manager_map.try_emplace( wallet.GetName(), std::make_unique(wallet, *this, m_mn_sync, m_queueman) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 6644ca9615..72adbc2840 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include @@ -114,7 +113,7 @@ bool AddWallet(const std::shared_ptr& wallet) } wallet->ConnectScriptPubKeyManNotifiers(); wallet->AutoLockMasternodeCollaterals(); - assert(::masternodeSync != nullptr && ::coinJoinClientManagers != nullptr); + assert(::coinJoinClientManagers != nullptr); ::coinJoinClientManagers->Add(*wallet); wallet->NotifyCanGetAddressesChanged(); return true; @@ -4819,7 +4818,7 @@ std::shared_ptr CWallet::Create(interfaces::Chain& chain, const std::st walletInstance->GetDatabase().IncrementUpdateCounter(); } - assert(::masternodeSync != nullptr && ::coinJoinClientManagers != nullptr); + assert(::coinJoinClientManagers != nullptr); ::coinJoinClientManagers->Add(*walletInstance); {