From 0365b06fabf0940f6b2a12add6977af3ad7d06ae Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 12 Jun 2024 19:41:30 +0300 Subject: [PATCH] fix: reset rounds to 0 when tx fee is not 0 --- src/wallet/wallet.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 42d0e0e4d6..a355a3a2aa 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1413,6 +1413,13 @@ int CWallet::GetRealOutpointCoinJoinRounds(const COutPoint& outpoint, int nRound } } + // make sure we spent all of it with 0 fee, reset to 0 rounds otherwise + if (wtx->GetDebit(ISMINE_SPENDABLE) != wtx->GetCredit(ISMINE_SPENDABLE)) { + *nRoundsRef = 0; + WalletCJLogPrint((*this), "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef); + return *nRoundsRef; + } + int nShortest = -10; // an initial value, should be no way to get this by calculations bool fDenomFound = false; // only denoms here so let's look up