mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Send reports success when the transaction is rejected by the local mempool #1008
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#1008
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?
The QML send flow can show “Transaction sent” even though the node rejected the transaction and did not broadcast it.
Still found a case where we show “Transaction sent” even though the node rejected it. Filled a regtest mempool until its minimum reached 0.677 sat/vB, then sent at 0.1.
The misleading success message is pre-existing. What this PR changes is making that case reachable with the default 1 sat/vB wallet minimum; removing just the two new overrides rejects preparation again.
Low fees are fine, but we should tell the user when the transaction hasn't been accepted locally. I'd handle that before shipping this path, with a test that checks mempool acceptance rather than just reaching the completion screen.
Originally posted by @jarolrod in https://github.com/bitcoin-core/gui-qml/pull/982#discussion_r4244096839
I traced the call chain.
CommitTransaction()already reachesBroadcastTransaction(), which checks local mempool acceptance and returns an error on rejection. That failure propagates back toCWallet::CommitTransaction(), where it is logged, but the function returnsvoid. The caller therefore receives no broadcast result. Relevant CodeWhile the GUI can use
getWalletTxDetails()to check whether the transaction was accepted, a more principled fix would be for Core to expose the mempool submission result and rejection reason throughCommitTransaction()andinterfaces::Wallet::commitTransaction(). This would let callers distinguish wallet persistence from successful submission, while preserving the saved transaction for later retries.Also reproduced this through Activity → Speed up on
d567e3eb2497, native macOS / Qt 6.9.0. The GUI says the replacement was broadcast even though the node rejected it, and marks the original as replaced while it’s still in the mempool.To reproduce on a disposable regtest node:
bitcoin-cli -regtest prioritisetransaction "<original_txid>" 0 100000against that node.getrawmempooland the wallet’s debug log. The original is still present, the replacement is absent, and the log reportsinsufficient fee.I used the priority change to force rejection after preparation. Removing it made the same replacement pass
testmempoolaccept; a separate GUI bump without the change was accepted normally.This hits the same commit/broadcast gap Ram described above.
commitBumpTransaction()returns success after saving the replacement, and we show the broadcast confirmation. We need the rejection result carried through this path too, so Speed up tells the user what actually happened. Worth including this case in the fee-bump tests around #976.There is another outcome this fix needs to distinguish: Core never attempts submission at all.
With
-walletbroadcast=0, Core saves the transaction to the wallet but skips mempool submission and relay.-blocksonly=1also reaches this state through its default interaction with wallet broadcasting, unless explicitly overridden.QML nevertheless shows Transaction sent and, with a Custom fee, Your transaction was broadcast. Confirmation depends on its fee rate. There is no rejection reason to display because submission was never attempted.
Steps to reproduce
-walletbroadcast=0, a funded wallet, and a second local regtest node as its connected peer.gettransactionin the wallet andgetmempoolentryon both nodes.The wallet contains the transaction, but neither node has it in its mempool. Activity shows it as Pending/Unconfirmed and offers Speed up. Speed up also claims its replacement was broadcast, although that replacement reaches neither mempool.
The same result occurs when signing and sending an imported unsigned wallet PSBT. An already-complete PSBT’s Broadcast transaction action uses a different, direct node-broadcast path and did reach the peer under the same flags.
Without either disabling flag, the control payments reached the peer and confirmed. In the affected runs, manually broadcasting through
sendrawtransactionor abandoning the stored transaction provided recovery.Core is honoring the configured broadcast policy. The problem is treating successful wallet storage as proof of submission: the commit interface does not give QML the outcome needed to justify its success message.
Review should explain when wallet broadcasting is disabled. Completion should distinguish created but not broadcast from successful submission, including the case where no submission was attempted. Handling mempool rejection alone would leave this case unresolved.
Reproduced on
qt6atd567e3eb2497, macOS arm64, Qt 6.9.0, offscreen and in the native GUI, using disposable regtest wallets and a local peer.There is also a Max-specific preparation gap: with broadcasting enabled and default policy, Use maximum can reach Review for a transaction that fixed-amount Send rejects before Review.
To reproduce:
The GUI reports success, but Core rejects the child with
too-large-cluster. The mempool contains the parents and no child. The wallet records the rejected transaction and makes its selected coins unavailable; abandoning that record restores them.A one-parent control works. After both parents confirm, the exact same signed two-parent child passes
testmempoolaccept. These controls isolate the unconfirmed-cluster condition.The QML Max builder omits
checkChainLimits, which regular Core transaction preparation performs.Max should apply the relevant preparation checks and report this rejection before Ready to send. That would address this deterministic preparation gap; the submission-result handling already discussed here is still needed for failures arising after preparation.
Reproduced with the full merged application at
6e54a48ab571, macOS / Qt 6.9, offscreen regtest. The fixture deliberately uses large unconfirmed parents under default policy.Since #1056 there is another way to reach this with default options: an imported unsigned PSBT whose fee rate is above the wallet's new fee-rate ceiling.
To reproduce on regtest:
walletprocesspsbt <psbt> falseand save it to a file.The GUI shows Transaction sent and Your transaction was broadcast. Confirmation depends on its fee rate. Core did not submit it:
getmempoolentrysays the transaction is not in the mempool.gettransactionshows 0 confirmations, and the whole 0.05 BTC coin is gone fromlistunspent.debug.loghasCommitTransaction(): Transaction cannot be broadcast immediately,with an empty reason.testmempoolaccept '["<hex>"]' 0allows the transaction, so the fee-rate ceiling is the only refusal.The default ceiling is 0.1 BTC/kvB, which is 1,100,000 sats for this transaction. A fee of 1,100,001 sats is committed and not broadcast, and a 500,000-sat fee is broadcast normally. With
-maxfeerate=0.0005the same happens at ordinary rates: 60 sat/vB is committed and not broadcast, and 45 sat/vB is broadcast.At default options this needs a PSBT made elsewhere with a fee rate above 10,000 sat/vB. The wallet's own Send form cannot build one.
A build with the previous Core pin (
dc282ff31d1c) broadcast the same 2,000,000-sat file in an offscreen run, so this trigger arrived with the Core update. By source, a total fee above-maxtxfeehad the same gap before the update; I did not run that case. The other two routes refuse visibly ateed1f426fcb6: an ordinary Send with a Custom rate above the ceiling fails at Review withFee rate exceeds maximum configured by user (maxfeerate), and a complete PSBT's Broadcast transaction showsTransaction broadcast failed: Fee rate exceeds maximum configured by user (maxfeerate). Only the imported unsigned PSBT reports success.The stuck transaction stays Pending after a block.
abandontransactionfrees the coin, and the GUI has no abandon action. Startingbitcoindon the same data directory with a higher ceiling submitted the stored transaction with no user action.The #1056 review added this check to the Use maximum builder after the same result was found there. The imported-PSBT branch of Send still commits without it. Commit, Core's rate check. A fix here should cover this branch, with a test that imports a PSBT above and below the ceiling. bitcoin/bitcoin#36597 would let Send report the failed submission, but the transaction would still be committed and its coin tied up, so this branch also needs the check before it commits.
One related detail: Broadcast transaction uses the fixed 0.1 BTC/kvB limit and not the wallet's
-maxfeerate, as Bitcoin-Qt's PSBT dialog does. With-maxfeerate=0.0005it broadcast a 60 sat/vB PSBT that Send would not relay.Reproduced on merged
qt6ateed1f426fcb6(Core44901d8f64cb), macOS / Qt 6.9, isolated regtest, offscreen and native. PSBT fixtures were built over RPC and the file path was supplied through the test-automation path field.