3131
3232PeerMsgRet CCoinJoinClientQueueManager::ProcessMessage (const CNode& peer, std::string_view msg_type, CDataStream& vRecv)
3333{
34- if (fMasternodeMode ) return {};
34+ if (m_is_masternode ) return {};
3535 if (!m_mn_sync.IsBlockchainSynced ()) return {};
3636
3737 if (msg_type == NetMsgType::DSQUEUE) {
@@ -133,7 +133,7 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataS
133133
134134void CCoinJoinClientManager::ProcessMessage (CNode& peer, CConnman& connman, const CTxMemPool& mempool, std::string_view msg_type, CDataStream& vRecv)
135135{
136- if (fMasternodeMode ) return ;
136+ if (m_is_masternode ) return ;
137137 if (!CCoinJoinClientOptions::IsEnabled ()) return ;
138138 if (!m_mn_sync.IsBlockchainSynced ()) return ;
139139
@@ -156,19 +156,20 @@ void CCoinJoinClientManager::ProcessMessage(CNode& peer, CConnman& connman, cons
156156}
157157
158158CCoinJoinClientSession::CCoinJoinClientSession (CWallet& wallet, CoinJoinWalletManager& walletman, CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman,
159- const CMasternodeSync& mn_sync, const std::unique_ptr<CCoinJoinClientQueueManager>& queueman) :
159+ const CMasternodeSync& mn_sync, const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode ) :
160160 m_wallet(wallet),
161161 m_walletman(walletman),
162162 m_manager(*Assert (walletman.Get(wallet.GetName()))),
163163 m_dmnman(dmnman),
164164 m_mn_metaman(mn_metaman),
165165 m_mn_sync(mn_sync),
166- m_queueman(queueman)
166+ m_queueman(queueman),
167+ m_is_masternode{is_masternode}
167168{}
168169
169170void CCoinJoinClientSession::ProcessMessage (CNode& peer, CConnman& connman, const CTxMemPool& mempool, std::string_view msg_type, CDataStream& vRecv)
170171{
171- if (fMasternodeMode ) return ;
172+ if (m_is_masternode ) return ;
172173 if (!CCoinJoinClientOptions::IsEnabled ()) return ;
173174 if (!m_mn_sync.IsBlockchainSynced ()) return ;
174175
@@ -385,7 +386,7 @@ bool CCoinJoinClientManager::GetMixingMasternodesInfo(std::vector<CDeterministic
385386//
386387bool CCoinJoinClientSession::CheckTimeout ()
387388{
388- if (fMasternodeMode ) return false ;
389+ if (m_is_masternode ) return false ;
389390
390391 if (nState == POOL_STATE_IDLE) return false ;
391392
@@ -422,7 +423,7 @@ bool CCoinJoinClientSession::CheckTimeout()
422423void CCoinJoinClientManager::CheckTimeout ()
423424{
424425 AssertLockNotHeld (cs_deqsessions);
425- if (fMasternodeMode ) return ;
426+ if (m_is_masternode ) return ;
426427
427428 if (!CCoinJoinClientOptions::IsEnabled () || !IsMixing ()) return ;
428429
@@ -440,7 +441,7 @@ void CCoinJoinClientManager::CheckTimeout()
440441//
441442bool CCoinJoinClientSession::SendDenominate (const std::vector<std::pair<CTxDSIn, CTxOut> >& vecPSInOutPairsIn, CConnman& connman)
442443{
443- if (fMasternodeMode ) {
444+ if (m_is_masternode ) {
444445 WalletCJLogPrint (m_wallet, " CCoinJoinClientSession::SendDenominate -- CoinJoin from a Masternode is not supported currently.\n " );
445446 return false ;
446447 }
@@ -497,7 +498,7 @@ bool CCoinJoinClientSession::SendDenominate(const std::vector<std::pair<CTxDSIn,
497498// Process incoming messages from Masternode updating the progress of mixing
498499void CCoinJoinClientSession::ProcessPoolStateUpdate (CCoinJoinStatusUpdate psssup)
499500{
500- if (fMasternodeMode ) return ;
501+ if (m_is_masternode ) return ;
501502
502503 // do not update state when mixing client state is one of these
503504 if (nState == POOL_STATE_IDLE || nState == POOL_STATE_ERROR) return ;
@@ -551,7 +552,7 @@ bool CCoinJoinClientSession::SignFinalTransaction(const CTxMemPool& mempool, con
551552{
552553 if (!CCoinJoinClientOptions::IsEnabled ()) return false ;
553554
554- if (fMasternodeMode ) return false ;
555+ if (m_is_masternode ) return false ;
555556 if (!mixingMasternode) return false ;
556557
557558 LOCK (m_wallet.cs_wallet );
@@ -680,7 +681,7 @@ bool CCoinJoinClientSession::SignFinalTransaction(const CTxMemPool& mempool, con
680681// mixing transaction was completed (failed or successful)
681682void CCoinJoinClientSession::CompletedTransaction (PoolMessage nMessageID)
682683{
683- if (fMasternodeMode ) return ;
684+ if (m_is_masternode ) return ;
684685
685686 if (nMessageID == MSG_SUCCESS) {
686687 m_manager.UpdatedSuccessBlock ();
@@ -697,7 +698,7 @@ void CCoinJoinClientSession::CompletedTransaction(PoolMessage nMessageID)
697698
698699void CCoinJoinClientManager::UpdatedSuccessBlock ()
699700{
700- if (fMasternodeMode ) return ;
701+ if (m_is_masternode ) return ;
701702 nCachedLastSuccessBlock = nCachedBlockHeight;
702703}
703704
@@ -782,7 +783,7 @@ bool CCoinJoinClientManager::CheckAutomaticBackup()
782783//
783784bool CCoinJoinClientSession::DoAutomaticDenominating (CConnman& connman, CTxMemPool& mempool, bool fDryRun )
784785{
785- if (fMasternodeMode ) return false ; // no client-side mixing on masternodes
786+ if (m_is_masternode ) return false ; // no client-side mixing on masternodes
786787 if (nState != POOL_STATE_IDLE) return false ;
787788
788789 if (!m_mn_sync.IsBlockchainSynced ()) {
@@ -962,7 +963,7 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CConnman& connman, CTxMemPo
962963
963964bool CCoinJoinClientManager::DoAutomaticDenominating (CConnman& connman, CTxMemPool& mempool, bool fDryRun )
964965{
965- if (fMasternodeMode ) return false ; // no client-side mixing on masternodes
966+ if (m_is_masternode ) return false ; // no client-side mixing on masternodes
966967 if (!CCoinJoinClientOptions::IsEnabled () || !IsMixing ()) return false ;
967968
968969 if (!m_mn_sync.IsBlockchainSynced ()) {
@@ -991,7 +992,7 @@ bool CCoinJoinClientManager::DoAutomaticDenominating(CConnman& connman, CTxMemPo
991992 AssertLockNotHeld (cs_deqsessions);
992993 LOCK (cs_deqsessions);
993994 if (int (deqSessions.size ()) < CCoinJoinClientOptions::GetSessions ()) {
994- deqSessions.emplace_back (m_wallet, m_walletman, m_dmnman, m_mn_metaman, m_mn_sync, m_queueman);
995+ deqSessions.emplace_back (m_wallet, m_walletman, m_dmnman, m_mn_metaman, m_mn_sync, m_queueman, m_is_masternode );
995996 }
996997 for (auto & session : deqSessions) {
997998 if (!CheckAutomaticBackup ()) return false ;
@@ -1832,7 +1833,7 @@ void CCoinJoinClientManager::UpdatedBlockTip(const CBlockIndex* pindex)
18321833
18331834void CCoinJoinClientQueueManager::DoMaintenance ()
18341835{
1835- if (fMasternodeMode ) return ; // no client-side mixing on masternodes
1836+ if (m_is_masternode ) return ; // no client-side mixing on masternodes
18361837
18371838 if (!m_mn_sync.IsBlockchainSynced () || ShutdownRequested ()) return ;
18381839
@@ -1842,7 +1843,7 @@ void CCoinJoinClientQueueManager::DoMaintenance()
18421843void CCoinJoinClientManager::DoMaintenance (CConnman& connman, CTxMemPool& mempool)
18431844{
18441845 if (!CCoinJoinClientOptions::IsEnabled ()) return ;
1845- if (fMasternodeMode ) return ; // no client-side mixing on masternodes
1846+ if (m_is_masternode ) return ; // no client-side mixing on masternodes
18461847
18471848 if (!m_mn_sync.IsBlockchainSynced () || ShutdownRequested ()) return ;
18481849
@@ -1893,7 +1894,7 @@ void CCoinJoinClientManager::GetJsonInfo(UniValue& obj) const
18931894void CoinJoinWalletManager::Add (CWallet& wallet) {
18941895 m_wallet_manager_map.try_emplace (
18951896 wallet.GetName (),
1896- std::make_unique<CCoinJoinClientManager>(wallet, *this , m_dmnman, m_mn_metaman, m_mn_sync, m_queueman)
1897+ std::make_unique<CCoinJoinClientManager>(wallet, *this , m_dmnman, m_mn_metaman, m_mn_sync, m_queueman, m_is_masternode )
18971898 );
18981899 g_wallet_init_interface.InitCoinJoinSettings (*this );
18991900}
0 commit comments