fix: Process dsq messages even when CJ is disabled locally or disk space is low (#5498)

Refusing to process `dsq` will result in node not being able to process
`dstx`es later.

n/a

- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
This commit is contained in:
UdjinM6 2023-07-24 18:05:27 +03:00
parent b7ef43f9dd
commit 66ef7943f5
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9

View File

@ -35,14 +35,8 @@ std::unique_ptr<CCoinJoinClientQueueManager> coinJoinClientQueueManager;
void CCoinJoinClientQueueManager::ProcessMessage(const CNode& peer, std::string_view msg_type, CDataStream& vRecv) void CCoinJoinClientQueueManager::ProcessMessage(const CNode& peer, std::string_view msg_type, CDataStream& vRecv)
{ {
if (fMasternodeMode) return; if (fMasternodeMode) return;
if (!CCoinJoinClientOptions::IsEnabled()) return;
if (!m_mn_sync->IsBlockchainSynced()) return; if (!m_mn_sync->IsBlockchainSynced()) return;
if (!CheckDiskSpace(GetDataDir())) {
LogPrint(BCLog::COINJOIN, "CCoinJoinClientQueueManager::ProcessMessage -- Not enough disk space, disabling CoinJoin.\n");
return;
}
if (msg_type == NetMsgType::DSQUEUE) { if (msg_type == NetMsgType::DSQUEUE) {
CCoinJoinClientQueueManager::ProcessDSQueue(peer, vRecv); CCoinJoinClientQueueManager::ProcessDSQueue(peer, vRecv);
} }
@ -1806,7 +1800,6 @@ void CCoinJoinClientManager::UpdatedBlockTip(const CBlockIndex* pindex)
void CCoinJoinClientQueueManager::DoMaintenance() void CCoinJoinClientQueueManager::DoMaintenance()
{ {
if (!CCoinJoinClientOptions::IsEnabled()) return;
if (m_mn_sync == nullptr) return; if (m_mn_sync == nullptr) return;
if (fMasternodeMode) return; // no client-side mixing on masternodes if (fMasternodeMode) return; // no client-side mixing on masternodes