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
1a88a3c7d9
commit
b9a738528c
@ -683,6 +683,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()) return true;
|
||||
|
@ -227,7 +227,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; }
|
||||
|
||||
|
@ -3532,8 +3532,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
|
||||
@ -3811,6 +3809,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