@@ -781,7 +781,7 @@ bool CCoinJoinClientManager::CheckAutomaticBackup()
781781//
782782// Passively run mixing in the background to mix funds based on the given configuration.
783783//
784- bool CCoinJoinClientSession::DoAutomaticDenominating (CConnman& connman, CTxMemPool& mempool, bool fDryRun )
784+ bool CCoinJoinClientSession::DoAutomaticDenominating (CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun )
785785{
786786 if (m_is_masternode) return false ; // no client-side mixing on masternodes
787787 if (nState != POOL_STATE_IDLE) return false ;
@@ -934,7 +934,7 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CConnman& connman, CTxMemPo
934934 return false ;
935935 }
936936 } else {
937- if (!CoinJoin::IsCollateralValid (mempool, CTransaction (txMyCollateral))) {
937+ if (!CoinJoin::IsCollateralValid (active_chainstate, mempool, CTransaction (txMyCollateral))) {
938938 WalletCJLogPrint (m_wallet, " CCoinJoinClientSession::DoAutomaticDenominating -- invalid collateral, recreating...\n " );
939939 if (!CreateCollateralTransaction (txMyCollateral, strReason)) {
940940 WalletCJLogPrint (m_wallet, " CCoinJoinClientSession::DoAutomaticDenominating -- create collateral error: %s\n " , strReason);
@@ -961,7 +961,7 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CConnman& connman, CTxMemPo
961961 return false ;
962962}
963963
964- bool CCoinJoinClientManager::DoAutomaticDenominating (CConnman& connman, CTxMemPool& mempool, bool fDryRun )
964+ bool CCoinJoinClientManager::DoAutomaticDenominating (CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun )
965965{
966966 if (m_is_masternode) return false ; // no client-side mixing on masternodes
967967 if (!CCoinJoinClientOptions::IsEnabled () || !IsMixing ()) return false ;
@@ -1003,7 +1003,7 @@ bool CCoinJoinClientManager::DoAutomaticDenominating(CConnman& connman, CTxMemPo
10031003 return false ;
10041004 }
10051005
1006- fResult &= session.DoAutomaticDenominating (connman, mempool, fDryRun );
1006+ fResult &= session.DoAutomaticDenominating (active_chainstate, connman, mempool, fDryRun );
10071007 }
10081008
10091009 return fResult ;
@@ -1840,7 +1840,7 @@ void CCoinJoinClientQueueManager::DoMaintenance()
18401840 CheckQueue ();
18411841}
18421842
1843- void CCoinJoinClientManager::DoMaintenance (CConnman& connman, CTxMemPool& mempool)
1843+ void CCoinJoinClientManager::DoMaintenance (CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool)
18441844{
18451845 if (!CCoinJoinClientOptions::IsEnabled ()) return ;
18461846 if (m_is_masternode) return ; // no client-side mixing on masternodes
@@ -1854,7 +1854,7 @@ void CCoinJoinClientManager::DoMaintenance(CConnman& connman, CTxMemPool& mempoo
18541854 CheckTimeout ();
18551855 ProcessPendingDsaRequest (connman);
18561856 if (nDoAutoNextRun == nTick) {
1857- DoAutomaticDenominating (connman, mempool);
1857+ DoAutomaticDenominating (active_chainstate, connman, mempool);
18581858 nDoAutoNextRun = nTick + COINJOIN_AUTO_TIMEOUT_MIN + GetRandInt (COINJOIN_AUTO_TIMEOUT_MAX - COINJOIN_AUTO_TIMEOUT_MIN);
18591859 }
18601860}
@@ -1901,9 +1901,10 @@ void CoinJoinWalletManager::Add(CWallet& wallet) {
19011901
19021902void CoinJoinWalletManager::DoMaintenance () {
19031903 for (auto & [wallet_str, walletman] : m_wallet_manager_map) {
1904- walletman->DoMaintenance (m_connman, m_mempool);
1904+ walletman->DoMaintenance (m_chainstate, m_connman, m_mempool);
19051905 }
19061906}
1907+
19071908void CoinJoinWalletManager::Remove (const std::string& name) {
19081909 m_wallet_manager_map.erase (name);
19091910 g_wallet_init_interface.InitCoinJoinSettings (*this );
0 commit comments