Skip to content

Commit d2af69f

Browse files
Merge dashpay#6058: fix: reset rounds to 0 when tx fee is not 0
0365b06 fix: reset rounds to 0 when tx fee is not 0 (UdjinM6) Pull request description: ## Issue being fixed or feature implemented > a coinjoin send with say 10x 1 + 0.001 denom -> 10 denom, and this doesn’t reset rounds to 0 reported by @PastaPastaPasta 👍 ## What was done? only real coinjoin tx can be a 0 fee tx with denoms, use that fact to avoid the edge case described above ## How Has This Been Tested? reproduced the issue ## Breaking Changes n/a ## Checklist: - [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)_ ACKs for top commit: PastaPastaPasta: ACK 0365b06 Tree-SHA512: b72ac5c01cc77c81945c3ae00b80fbdc4884acf3cfadc3fbcf4b78ff5655cce3b2ece4885478e5bf7476d351411df88b967d2baa3925155cffdc6054dd3bb502
2 parents 5baa522 + 0365b06 commit d2af69f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,13 @@ int CWallet::GetRealOutpointCoinJoinRounds(const COutPoint& outpoint, int nRound
14131413
}
14141414
}
14151415

1416+
// make sure we spent all of it with 0 fee, reset to 0 rounds otherwise
1417+
if (wtx->GetDebit(ISMINE_SPENDABLE) != wtx->GetCredit(ISMINE_SPENDABLE)) {
1418+
*nRoundsRef = 0;
1419+
WalletCJLogPrint((*this), "%s UPDATED %-70s %3d\n", __func__, outpoint.ToStringShort(), *nRoundsRef);
1420+
return *nRoundsRef;
1421+
}
1422+
14161423
int nShortest = -10; // an initial value, should be no way to get this by calculations
14171424
bool fDenomFound = false;
14181425
// only denoms here so let's look up

0 commit comments

Comments
 (0)