refactor: assert of masternodeSync existance moved from wallet to coinjoin

This commit is contained in:
Konstantin Akimov 2023-12-13 02:53:01 +07:00 committed by pasta
parent f6f6131524
commit 52153d9849
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
2 changed files with 3 additions and 3 deletions

View File

@ -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<CCoinJoinClientManager>(wallet, *this, m_mn_sync, m_queueman)

View File

@ -44,7 +44,6 @@
#include <coinjoin/client.h>
#include <coinjoin/options.h>
#include <evo/providertx.h>
#include <masternode/sync.h>
#include <univalue.h>
@ -114,7 +113,7 @@ bool AddWallet(const std::shared_ptr<CWallet>& 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> CWallet::Create(interfaces::Chain& chain, const std::st
walletInstance->GetDatabase().IncrementUpdateCounter();
}
assert(::masternodeSync != nullptr && ::coinJoinClientManagers != nullptr);
assert(::coinJoinClientManagers != nullptr);
::coinJoinClientManagers->Add(*walletInstance);
{