Send reports success when the transaction is rejected by the local mempool #1008

Open
opened 2026-10-13 09:13:01 +00:00 by pseudoramdom · 5 comments
pseudoramdom commented 2026-10-13 09:13:01 +00:00 (Migrated from github.com)

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

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_
pseudoramdom commented 2026-10-13 20:35:15 +00:00 (Migrated from github.com)

I traced the call chain. CommitTransaction() already reaches BroadcastTransaction(), which checks local mempool acceptance and returns an error on rejection. That failure propagates back to CWallet::CommitTransaction(), where it is logged, but the function returns void. The caller therefore receives no broadcast result. Relevant Code

While 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 through CommitTransaction() and interfaces::Wallet::commitTransaction(). This would let callers distinguish wallet persistence from successful submission, while preserving the saved transaction for later retries.

I traced the call chain. `CommitTransaction()` already reaches `BroadcastTransaction()`, which checks local mempool acceptance and returns an error on rejection. That failure propagates back to `CWallet::CommitTransaction()`, where it is logged, but the function returns `void`. The caller therefore receives no broadcast result. [Relevant Code](https://github.com/bitcoin/bitcoin/blob/dc282ff31d1cc97507530a541d9cec8a8f6a6ef4/src/wallet/wallet.cpp#L2366-L2370) While 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 through `CommitTransaction()` and `interfaces::Wallet::commitTransaction()`. This would let callers distinguish wallet persistence from successful submission, while preserving the saved transaction for later retries.
jarolrod commented 2026-10-15 07:36:11 +00:00 (Migrated from github.com)

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:

  1. Use a funded wallet to make an unconfirmed, replaceable payment at 1 sat/vB.
  2. Open it in Activity, click Speed up, and leave the confirmation open. Mine offered 141 → 1,410 sats.
  3. Run bitcoin-cli -regtest prioritisetransaction "<original_txid>" 0 100000 against that node.
  4. Click Update transaction.
  5. Check getrawmempool and the wallet’s debug log. The original is still present, the replacement is absent, and the log reports insufficient 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.

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: 1. Use a funded wallet to make an unconfirmed, replaceable payment at 1 sat/vB. 2. Open it in Activity, click Speed up, and leave the confirmation open. Mine offered 141 → 1,410 sats. 3. Run `bitcoin-cli -regtest prioritisetransaction "<original_txid>" 0 100000` against that node. 4. Click Update transaction. 5. Check `getrawmempool` and the wallet’s debug log. The original is still present, the replacement is absent, and the log reports `insufficient 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.
jarolrod commented 2026-11-05 14:31:26 +00:00 (Migrated from github.com)

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=1 also 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

  1. Start the GUI on regtest with -walletbroadcast=0, a funded wallet, and a second local regtest node as its connected peer.
  2. Send 1 BTC through the GUI using a Custom fee.
  3. Observe the successful completion page and its broadcast confirmation.
  4. Check the transaction with gettransaction in the wallet and getmempoolentry on 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 sendrawtransaction or 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 qt6 at d567e3eb2497, macOS arm64, Qt 6.9.0, offscreen and in the native GUI, using disposable regtest wallets and a local peer.

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=1` also 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** 1. Start the GUI on regtest with `-walletbroadcast=0`, a funded wallet, and a second local regtest node as its connected peer. 2. Send 1 BTC through the GUI using a Custom fee. 3. Observe the successful completion page and its broadcast confirmation. 4. Check the transaction with `gettransaction` in the wallet and `getmempoolentry` on 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 `sendrawtransaction` or 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 `qt6` at `d567e3eb2497`, macOS arm64, Qt 6.9.0, offscreen and in the native GUI, using disposable regtest wallets and a local peer.
jarolrod commented 2026-11-09 01:18:28 +00:00 (Migrated from github.com)

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:

  1. Receive spendable outputs from two unconfirmed parents that are individually accepted but would exceed the cluster-size limit when joined. The fixture used two 52,125-vB parents against the default 101,000-vB limit.
  2. Select one output from each parent and attempt a fixed-amount payment. Preparation rejects it before Review.
  3. Keep the same selected inputs and choose Use maximum. Review becomes available and shows Ready to send.
  4. Click Send.

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.

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: 1. Receive spendable outputs from two unconfirmed parents that are individually accepted but would exceed the cluster-size limit when joined. The fixture used two 52,125-vB parents against the default 101,000-vB limit. 2. Select one output from each parent and attempt a fixed-amount payment. Preparation rejects it before Review. 3. Keep the same selected inputs and choose Use maximum. Review becomes available and shows Ready to send. 4. Click Send. 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](https://github.com/bitcoin-core/gui-qml/blob/6e54a48ab571cb46b813eb1d98a301401089192f/qml/models/walletqmlmodel.cpp#L280) omits `checkChainLimits`, which [regular Core transaction preparation](https://github.com/bitcoin/bitcoin/blob/dc282ff31d1cc97507530a541d9cec8a8f6a6ef4/src/wallet/spend.cpp#L1423) 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.
jarolrod commented 2026-11-10 22:28:22 +00:00 (Migrated from github.com)

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:

  1. Build an unsigned PSBT that spends one 0.05 BTC wallet coin and pays 0.03 BTC, leaving a 2,000,000-sat fee on a 110 vB transaction. Add the wallet's UTXO data with walletprocesspsbt <psbt> false and save it to a file.
  2. Open Send → Options → Import PSBT and choose the file. Review shows Ready to send with total fees of 0.02000000 BTC.
  3. Click Send transaction.

The GUI shows Transaction sent and Your transaction was broadcast. Confirmation depends on its fee rate. Core did not submit it:

  • getmempoolentry says the transaction is not in the mempool.
  • gettransaction shows 0 confirmations, and the whole 0.05 BTC coin is gone from listunspent.
  • debug.log has CommitTransaction(): Transaction cannot be broadcast immediately, with an empty reason.
  • testmempoolaccept '["<hex>"]' 0 allows 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.0005 the 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 -maxtxfee had the same gap before the update; I did not run that case. The other two routes refuse visibly at eed1f426fcb6: an ordinary Send with a Custom rate above the ceiling fails at Review with Fee rate exceeds maximum configured by user (maxfeerate), and a complete PSBT's Broadcast transaction shows Transaction 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. abandontransaction frees the coin, and the GUI has no abandon action. Starting bitcoind on 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.0005 it broadcast a 60 sat/vB PSBT that Send would not relay.

Reproduced on merged qt6 at eed1f426fcb6 (Core 44901d8f64cb), 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.

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: 1. Build an unsigned PSBT that spends one 0.05 BTC wallet coin and pays 0.03 BTC, leaving a 2,000,000-sat fee on a 110 vB transaction. Add the wallet's UTXO data with `walletprocesspsbt <psbt> false` and save it to a file. 2. Open **Send → Options → Import PSBT** and choose the file. Review shows **Ready to send** with total fees of 0.02000000 BTC. 3. Click **Send transaction**. The GUI shows **Transaction sent** and **Your transaction was broadcast. Confirmation depends on its fee rate.** Core did not submit it: - `getmempoolentry` says the transaction is not in the mempool. - `gettransaction` shows 0 confirmations, and the whole 0.05 BTC coin is gone from `listunspent`. - `debug.log` has `CommitTransaction(): Transaction cannot be broadcast immediately,` with an empty reason. - `testmempoolaccept '["<hex>"]' 0` allows 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.0005` the 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 `-maxtxfee` had the same gap before the update; I did not run that case. The other two routes refuse visibly at `eed1f426fcb6`: an ordinary Send with a Custom rate above the ceiling fails at Review with `Fee rate exceeds maximum configured by user (maxfeerate)`, and a complete PSBT's **Broadcast transaction** shows `Transaction 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. `abandontransaction` frees the coin, and the GUI has no abandon action. Starting `bitcoind` on 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](https://github.com/bitcoin-core/gui-qml/blob/eed1f426fcb64daa61b004590335a03afe376274/qml/models/walletqmlmodel.cpp#L2628-L2645), [Core's rate check](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/src/node/transaction.cpp#L82-L86). 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.0005` it broadcast a 60 sat/vB PSBT that Send would not relay. Reproduced on merged `qt6` at `eed1f426fcb6` (Core `44901d8f64cb`), 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.
Sign in to join this conversation.
No description provided.