Skip to content

Commit 2dc1b06

Browse files
UdjinM6codablock
andcommitted
Remove skipped denom from the list on tx commit (#2997)
* Remove skipped denom from the list on tx commit Regardless of the tx type (PS or not). * Update src/privatesend/privatesend-client.cpp Co-Authored-By: Alexander Block <ablock84@gmail.com>
1 parent dff2c85 commit 2dc1b06

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/privatesend-client.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,11 @@ void CPrivateSendClientManager::AddSkippedDenom(const CAmount& nDenomValue)
712712
vecDenominationsSkipped.push_back(nDenomValue);
713713
}
714714

715+
void CPrivateSendClientManager::RemoveSkippedDenom(const CAmount& nDenomValue)
716+
{
717+
vecDenominationsSkipped.erase(std::remove(vecDenominationsSkipped.begin(), vecDenominationsSkipped.end(), nDenomValue), vecDenominationsSkipped.end());
718+
}
719+
715720
bool CPrivateSendClientManager::WaitForAnotherBlock()
716721
{
717722
if (!masternodeSync.IsBlockchainSynced())

src/privatesend-client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class CPrivateSendClientManager : public CPrivateSendBaseManager
232232

233233
bool IsDenomSkipped(const CAmount& nDenomValue);
234234
void AddSkippedDenom(const CAmount& nDenomValue);
235-
void ClearSkippedDenominations() { vecDenominationsSkipped.clear(); }
235+
void RemoveSkippedDenom(const CAmount& nDenomValue);
236236

237237
void SetMinBlocksToWait(int nMinBlocksToWaitIn) { nMinBlocksToWait = nMinBlocksToWaitIn; }
238238

src/wallet/wallet.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3481,8 +3481,6 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
34813481
if (nCoinType == ONLY_DENOMINATED) {
34823482
nFeeRet += nChange;
34833483
wtxNew.mapValue["DS"] = "1";
3484-
// recheck skipped denominations during next mixing
3485-
privateSendClient.ClearSkippedDenominations();
34863484
} else {
34873485

34883486
// Fill a vout to ourself
@@ -3763,6 +3761,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon
37633761
coin.BindWallet(this);
37643762
NotifyTransactionChanged(this, txin.prevout.hash, CT_UPDATED);
37653763
updated_hahes.insert(txin.prevout.hash);
3764+
privateSendClient.RemoveSkippedDenom(coin.tx->vout[txin.prevout.n].nValue);
37663765
}
37673766
}
37683767

0 commit comments

Comments
 (0)