mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:18:39 +00:00
Send fees: avoid creating wallet addresses for fee previews #715
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#715
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
QML send fee preview currently calls
WalletQmlModel::ensurePreviewChangeAddress(), which generates a wallet destination with the labelqml-fee-preview:qml/models/walletqmlmodel.cpp:ensurePreviewChangeAddress()m_wallet->getNewDestination(m_wallet->getDefaultAddressType(), "qml-fee-preview")That destination is cached for the current
WalletQmlModellifetime, so it does not create a new address on every estimate. However, it still creates a real receive/address-book entry, and after app restart or wallet model recreation another preview address can be generated.The fee preview path only needs to estimate fees. It should not consume wallet addresses or leave
qml-fee-previewentries in wallet state/address-book surfaces.Expected behavior
Send fee preview should estimate transaction fees without creating persistent wallet addresses or address-book entries.
Repeated preview updates, app restarts, and wallet reloads should not accumulate preview-only receive addresses.
Implementation notes
The current code pins a preview change destination to avoid a worse behavior: if
coin_control.destChangeis left unset,CreateTransactionInternal()reserves an internal change destination and keeps it on success, even for unsigned preview transactions. Since fee preview runs repeatedly for High/Default/Low/custom estimates, simply removing the pinned destination would likely burn internal change indexes.Potential safer approaches:
CTxDestinationwith the same output type for preview-onlycoin_control.destChange, so fee estimation has the right script shape without asking the wallet for a new address.The Review page should remain the authoritative final preview because it prepares the real transaction candidate.
Acceptance criteria
getNewDestination()just to estimate fees.qml-fee-previewaddress-book entries.