mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
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>
This commit is contained in:
parent
dff2c851d5
commit
2dc1b06ec7
@ -712,6 +712,11 @@ void CPrivateSendClientManager::AddSkippedDenom(const CAmount& nDenomValue)
|
||||
vecDenominationsSkipped.push_back(nDenomValue);
|
||||
}
|
||||
|
||||
void CPrivateSendClientManager::RemoveSkippedDenom(const CAmount& nDenomValue)
|
||||
{
|
||||
vecDenominationsSkipped.erase(std::remove(vecDenominationsSkipped.begin(), vecDenominationsSkipped.end(), nDenomValue), vecDenominationsSkipped.end());
|
||||
}
|
||||
|
||||
bool CPrivateSendClientManager::WaitForAnotherBlock()
|
||||
{
|
||||
if (!masternodeSync.IsBlockchainSynced())
|
||||
|
@ -232,7 +232,7 @@ public:
|
||||
|
||||
bool IsDenomSkipped(const CAmount& nDenomValue);
|
||||
void AddSkippedDenom(const CAmount& nDenomValue);
|
||||
void ClearSkippedDenominations() { vecDenominationsSkipped.clear(); }
|
||||
void RemoveSkippedDenom(const CAmount& nDenomValue);
|
||||
|
||||
void SetMinBlocksToWait(int nMinBlocksToWaitIn) { nMinBlocksToWait = nMinBlocksToWaitIn; }
|
||||
|
||||
|
@ -3481,8 +3481,6 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
|
||||
if (nCoinType == ONLY_DENOMINATED) {
|
||||
nFeeRet += nChange;
|
||||
wtxNew.mapValue["DS"] = "1";
|
||||
// recheck skipped denominations during next mixing
|
||||
privateSendClient.ClearSkippedDenominations();
|
||||
} else {
|
||||
|
||||
// Fill a vout to ourself
|
||||
@ -3763,6 +3761,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon
|
||||
coin.BindWallet(this);
|
||||
NotifyTransactionChanged(this, txin.prevout.hash, CT_UPDATED);
|
||||
updated_hahes.insert(txin.prevout.hash);
|
||||
privateSendClient.RemoveSkippedDenom(coin.tx->vout[txin.prevout.n].nValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user