mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:18:39 +00:00
A bunch of fixes for Preview release target #736
No reviewers
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!736
Loading…
Reference in a new issue
No description provided.
Delete branch "preview-send-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR groups Preview-targeted fixes around Send correctness, fee preview behavior, wallet shutdown/lifecycle handling, receive-request compatibility, and small wallet UI polish.
Issues
Fixes #467 - Send amount validation accounts for the selected fee estimate before allowing review.
Fixes #624 - Create-backup
View fileopens the selected wallet location and reports failures.Fixes #636 - Fee bump confirmation prompts to unlock encrypted wallets and relocks after signing.
Fixes #692 - RBF speed-up prompts to unlock encrypted wallets before confirming and is covered by the encrypted-wallet RBF functional test.
Fixes #659 - Send validation rejects duplicate recipients and dust outputs before review.
Fixes #665 - Coin control selections are cleared after send and when clearing recipients.
Fixes #739 - QML coin control treats manually selected coins as exclusive during fee preview and transaction preparation.
Fixes #705 - Send review stays disabled when any visible multi-recipient row is incomplete, with a clear validation error.
Fixes #712 - Update-password mode focuses the current-password field first.
Fixes #715 - Fee previews no longer create persistent
qml-fee-previewwallet addresses.Fixes #721 - Receive request serialization stays compatible with bitcoin-qt and is covered by a bitcoin-qt v31.0 regression workflow.
Fixes #728 - Navigation button content padding is restored.
Fixes #730 -
NodeModelunsubscribes from core signals during destruction.Fixes #731 - SIGINT/Ctrl+C during interrupted initialization exits cleanly instead of hanging.
Refs #582
Refs #577
Refs #579
To finish closing out issue https://github.com/bitcoin-core/gui-qml/issues/730, we need to finish the implementation of
unsubscribeFromCoreSignals().The precedent in Qt Widgets is that all owned Core signal handlers are disconnected during teardown. For example,
ClientModelclears all node event handlers, andBitcoinGUIdisconnects both message/question handlers.NodeModelcurrently registers eight Core handlers, butunsubscribeFromCoreSignals()only disconnects three of them. The remaining header, network, alert, messagebox, and question handlers also capturethis, and the runtime dialog handlers can block. They should be disconnected before shutdown begins.You could do something like this:
While these unit tests are good it's probably worthwhile to do a functional test so we can have
appInitMain()running and have the GUI be in theload_on_startuppath while the OS signal is delivered -> since that is where the hang occurred previously.We could add a functional test like so:
I think its wrong to use this here
This should use the node’s active dust relay fee instead of the static default DUST_RELAY_TX_FEE.
DUST_RELAY_TX_FEE is only the default value. The node policy can be changed with -dustrelayfee, and Qt Widgets already validates dust with node.getDustRelayFee().
Wallet transaction creation also uses the live relay dust fee, so this seems wrong to do like this.
while auditing the changes around coin control, I think there is still an adjacent coin-control parity issue here.
It seems selected coins are still not exclusive during transaction preparation.
CCoinControl::m_allow_other_inputs defaults to true, which means Core will require the selected inputs but may still add additional unselected wallet inputs. Qt Widgets overrides this before preparing a send:
coin_control.m_allow_other_inputs = !coin_control.HasSelected();As QML isn't doing that, it can prepare a transaction that spends the user-selected coins plus other wallet coins. I haven't exactly tested, but that is the logical conclusion. Probably worth it to reevaluate the context around this, the wallet, and qt widgets; and maybe include any changes here or open an issue to be addressed as a follow-up.
Yeah i built these already. I guess they got lost in the shuffle. Will add back the shutdown qml functional test.
Will look into this.
I'll see how big of an issue this is.
added #739 for tracking and made an attempt
Should disconnect all handlers now
I think this is correct and matches the intended behavior of the user interface
We've got some weird UX going on.
If I select a UTXO with amount less than the one I'm sending, the "Review" button is enabled. But we get stopped after entering the passphrase.
We should probably emit
Q_EMIT sendAmountExhaustsBalanceChanged()on coin selectionhttps://github.com/user-attachments/assets/5534e3ef-4876-4ea9-be2c-c41e098ff063
I'll take a look at this. It is a gap with the calculations when considering coin control and the added coin control restriction to not include other coins. I changed coin control to not pull in other coins if the amount isnt covered and I didnt update the rules for deciding if we have enough of the amount covered
The root cause looks like the pre-review check is still using the full wallet balance, while the actual prepare path now uses coincontrol aware available balance, from my previous review.
Emitting
sendAmountExhaustsBalanceChanged()on coin selection is needed so the button refreshes immediately, but it won’t fix the mismatch by itself.I think this path should use the same effective balance as
prepareTransactionInternal(), then apply the sameCCoinControlpolicy and callgetAvailableBalance(coin_control), ideally through a small shared helper so Review and prepare can’t drift in the future.There is another adjacent state issue here around this code, thought not as important as this one.
When send inputs change, this only schedules a future preview. The existing fee estimate is not marked stale, and
feeEstimatePendingis not set untilrequestFeeEstimatesNow()runs after the debounce.Even after that, the preview still runs asynchronously. During that whole period,
sendAmountExhaustsBalance()can still answer using either no estimate or an estimate from the previous send inputs.That means the Review enabled state can temporarily be based on fee data that does not correspond to the current reality; of course keep in mind we're talking about 250ms, so its not the worst thing.
But architecturally, and this is where my comment focuses on, it means the model does not know whether the selected fee estimate is current, which makes the pre-review check quite weak, and its worthwhile to revisit the architecture,
The text in red while doing RBF is redundant.

maybe also assert the wallet is locked again after the successful bump?
After the passphrase popup closes and the bump succeeds, checking
getwalletinfo()["unlocked_until"] == 0would catch a regression where the gui signs but leaves the wallet unlocked.don't we need to add the new shutdown test here?
Stale pending reviews should be ignored now.
Set the default text to ""
nit: The payment message and the import result seem to be not up to spec.
This is what I see in Figma.

"The payment request imported..." should probably be a toast banner.
I can fix both in my upcoming PR for PSBT where I'm fixing the Send page layout.
Ill leave it to you then if you already have some ideas or considerations with relation to PSBT.
We should probably call
root.scheduleFeeEstimates()so that we don't see a stale fee after importing the URIIf I import a URI without label/message to a form that has label & message, should we clear them out?
ACK
fdb30e81ef