fix: Qt wallet mint fails on fragmented UTXOs — missing auto-consolidation#396
Open
JohnnyLawDGB wants to merge 1 commit intoDigiByte-Core:feature/digidollar-v1from
Open
Conversation
The RPC mintdigidollar handler had auto-consolidation logic (PR DigiByte-Core#391) that detects when a mint fails due to UTXO fragmentation (>400 inputs needed) and automatically consolidates UTXOs before retrying. The Qt wallet's mintDigiDollar in walletmodel.cpp was missing this logic entirely — it called BuildMintTransaction once and returned the error on failure. This caused Qt GUI users with many small coinbase UTXOs (e.g. ~1,078 DGB each from mining) to fail mints that required more than ~431,400 DGB (400 inputs * ~1,078 DGB), while the same mint via RPC would succeed. Reported by Aussie and DanGB on RC29 testnet. Port the multi-pass consolidation from src/rpc/digidollar.cpp into the Qt mint path with identical parameters (1400 inputs/pass, 10 max passes). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BuildMintTransactionenforces a 400-input limit (~431,400 DGB max) and the Qt path had no consolidation fallbackmintdigidollarhandler (src/rpc/digidollar.cpp:983-1111) but the Qt wallet'smintDigiDollar(src/qt/walletmodel.cpp) was never updated with the same logic — it calledBuildMintTransactiononce and returned the error directly on failureReproduction (reported by Aussie and DanGB on RC29 testnet)
DanGB has 11M tDGB across thousands of ~1,078 DGB coinbase UTXOs. Aussie has a similar distribution. Both confirmed $100 works but $200+ fails in Qt. The RPC path would have auto-consolidated and succeeded.
How it works
BuildMintTransactionattempts the mint — if it fails with "Too many small UTXOs":BuildMintTransactionwith the consolidated UTXO setTest plan
mintdigidollarbehavior unchanged🤖 Generated with Claude Code