@@ -781,7 +781,7 @@ bool CCoinJoinClientManager::CheckAutomaticBackup()
781
781
//
782
782
// Passively run mixing in the background to mix funds based on the given configuration.
783
783
//
784
- bool CCoinJoinClientSession::DoAutomaticDenominating (CConnman& connman, CTxMemPool& mempool, bool fDryRun )
784
+ bool CCoinJoinClientSession::DoAutomaticDenominating (CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun )
785
785
{
786
786
if (m_is_masternode) return false ; // no client-side mixing on masternodes
787
787
if (nState != POOL_STATE_IDLE) return false ;
@@ -934,7 +934,7 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CConnman& connman, CTxMemPo
934
934
return false ;
935
935
}
936
936
} else {
937
- if (!CoinJoin::IsCollateralValid (mempool, CTransaction (txMyCollateral))) {
937
+ if (!CoinJoin::IsCollateralValid (active_chainstate, mempool, CTransaction (txMyCollateral))) {
938
938
WalletCJLogPrint (m_wallet, " CCoinJoinClientSession::DoAutomaticDenominating -- invalid collateral, recreating...\n " );
939
939
if (!CreateCollateralTransaction (txMyCollateral, strReason)) {
940
940
WalletCJLogPrint (m_wallet, " CCoinJoinClientSession::DoAutomaticDenominating -- create collateral error: %s\n " , strReason);
@@ -961,7 +961,7 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CConnman& connman, CTxMemPo
961
961
return false ;
962
962
}
963
963
964
- bool CCoinJoinClientManager::DoAutomaticDenominating (CConnman& connman, CTxMemPool& mempool, bool fDryRun )
964
+ bool CCoinJoinClientManager::DoAutomaticDenominating (CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun )
965
965
{
966
966
if (m_is_masternode) return false ; // no client-side mixing on masternodes
967
967
if (!CCoinJoinClientOptions::IsEnabled () || !IsMixing ()) return false ;
@@ -1003,7 +1003,7 @@ bool CCoinJoinClientManager::DoAutomaticDenominating(CConnman& connman, CTxMemPo
1003
1003
return false ;
1004
1004
}
1005
1005
1006
- fResult &= session.DoAutomaticDenominating (connman, mempool, fDryRun );
1006
+ fResult &= session.DoAutomaticDenominating (active_chainstate, connman, mempool, fDryRun );
1007
1007
}
1008
1008
1009
1009
return fResult ;
@@ -1840,7 +1840,7 @@ void CCoinJoinClientQueueManager::DoMaintenance()
1840
1840
CheckQueue ();
1841
1841
}
1842
1842
1843
- void CCoinJoinClientManager::DoMaintenance (CConnman& connman, CTxMemPool& mempool)
1843
+ void CCoinJoinClientManager::DoMaintenance (CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool)
1844
1844
{
1845
1845
if (!CCoinJoinClientOptions::IsEnabled ()) return ;
1846
1846
if (m_is_masternode) return ; // no client-side mixing on masternodes
@@ -1854,7 +1854,7 @@ void CCoinJoinClientManager::DoMaintenance(CConnman& connman, CTxMemPool& mempoo
1854
1854
CheckTimeout ();
1855
1855
ProcessPendingDsaRequest (connman);
1856
1856
if (nDoAutoNextRun == nTick) {
1857
- DoAutomaticDenominating (connman, mempool);
1857
+ DoAutomaticDenominating (active_chainstate, connman, mempool);
1858
1858
nDoAutoNextRun = nTick + COINJOIN_AUTO_TIMEOUT_MIN + GetRandInt (COINJOIN_AUTO_TIMEOUT_MAX - COINJOIN_AUTO_TIMEOUT_MIN);
1859
1859
}
1860
1860
}
@@ -1901,9 +1901,10 @@ void CoinJoinWalletManager::Add(CWallet& wallet) {
1901
1901
1902
1902
void CoinJoinWalletManager::DoMaintenance () {
1903
1903
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);
1905
1905
}
1906
1906
}
1907
+
1907
1908
void CoinJoinWalletManager::Remove (const std::string& name) {
1908
1909
m_wallet_manager_map.erase (name);
1909
1910
g_wallet_init_interface.InitCoinJoinSettings (*this );
0 commit comments