Import PSBT shows “Ready to broadcast” without accounting for transaction identity or current node state #1071

Open
opened 2026-11-05 14:14:19 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-05 14:14:19 +00:00 (Migrated from github.com)

Import PSBT treats a complete PSBT with a known fee as ready for broadcast without checking whether the finalized transaction is already known, currently acceptable to the node, or a replacement for another transaction.

These states need different review outcomes. Currently, rejected transactions can receive the same Ready state as valid payments, and an accepted replacement is presented without identifying the transaction it replaces.

Inputs already spent by another transaction

  1. Create and sign a PSBT, A, spending a confirmed wallet coin. Save it without broadcasting.
  2. Create a different transaction, B, spending the same coin to a different destination, and broadcast B.
  3. Mine B, then import the saved PSBT A through Send → Options → Import PSBT.
  4. Observe Ready to broadcast and the enabled Broadcast transaction button.

The node’s testmempoolaccept rejects A with missing-inputs. Clicking Broadcast does not broadcast it; the recorded GUI run remains on review without a visible explanation.

In a separate run, leave B unconfirmed and give A a sufficiently higher fee to satisfy replacement policy. Importing A produces the same Ready review. Broadcasting succeeds and replaces B, but neither review nor completion identifies B or explains that this payment replaces it.

The replacement itself is valid under node policy. The missing behavior is disclosure and confirmation of that consequence.

Other non-broadcastable transactions

The same Ready state appears for:

  • A fully signed PSBT with nLockTime 500 blocks ahead and an input sequence that makes the locktime effective. The node rejects it with non-final.
  • A fully signed, zero-fee PSBT under a positive minimum relay fee. The node rejects it with min relay fee not met.

In the recorded runs, clicking Broadcast did not submit either transaction successfully, and the review did not show the applicable reason.

Already-known transactions

  1. Create and sign a PSBT spending a P2PKH or P2SH-P2WPKH input.
  2. Save the signed PSBT, extract its finalized transaction, and broadcast it.
  3. Import the saved PSBT, both before and after confirmation.

The GUI opens a new Ready review instead of recognizing the transaction. The native-SegWit control correctly opens the already-known dialog.

The lookup uses the unsigned transaction’s hash. For legacy and wrapped-SegWit inputs, the finalized scriptSig changes the txid, so the lookup misses the transaction already recorded by the wallet.

Expected behavior and responsibility

QML should use the finalized transaction identity and current node results to distinguish:

  • Already-known transactions.
  • Transactions that cannot currently be broadcast, with an actionable reason.
  • Valid replacements, identifying the affected transaction before confirmation.
  • Ordinary new transactions eligible for broadcast.

Recheck the result when broadcasting and display any failure that occurs after review.

Core’s AnalyzePSBT is not a current mempool-admission check. Core correctly rejects the non-admissible examples and accepts the eligible replacement. The defect is in QML’s review/broadcast integration and its already-known lookup.

Spent-input, replacement, locktime, and minimum-fee cases were reproduced on the merged build at 6e54a48ab571. The legacy/wrapped-SegWit already-known cases were reproduced at d567e3eb2497. All used macOS arm64, Qt 6.9.0, and disposable regtest fixtures.

Import PSBT treats a complete PSBT with a known fee as ready for broadcast without checking whether the finalized transaction is already known, currently acceptable to the node, or a replacement for another transaction. These states need different review outcomes. Currently, rejected transactions can receive the same Ready state as valid payments, and an accepted replacement is presented without identifying the transaction it replaces. **Inputs already spent by another transaction** 1. Create and sign a PSBT, A, spending a confirmed wallet coin. Save it without broadcasting. 2. Create a different transaction, B, spending the same coin to a different destination, and broadcast B. 3. Mine B, then import the saved PSBT A through **Send → Options → Import PSBT**. 4. Observe **Ready to broadcast** and the enabled **Broadcast transaction** button. The node’s `testmempoolaccept` rejects A with `missing-inputs`. Clicking Broadcast does not broadcast it; the recorded GUI run remains on review without a visible explanation. In a separate run, leave B unconfirmed and give A a sufficiently higher fee to satisfy replacement policy. Importing A produces the same Ready review. Broadcasting succeeds and replaces B, but neither review nor completion identifies B or explains that this payment replaces it. The replacement itself is valid under node policy. The missing behavior is disclosure and confirmation of that consequence. **Other non-broadcastable transactions** The same Ready state appears for: - A fully signed PSBT with `nLockTime` 500 blocks ahead and an input sequence that makes the locktime effective. The node rejects it with `non-final`. - A fully signed, zero-fee PSBT under a positive minimum relay fee. The node rejects it with `min relay fee not met`. In the recorded runs, clicking Broadcast did not submit either transaction successfully, and the review did not show the applicable reason. **Already-known transactions** 1. Create and sign a PSBT spending a P2PKH or P2SH-P2WPKH input. 2. Save the signed PSBT, extract its finalized transaction, and broadcast it. 3. Import the saved PSBT, both before and after confirmation. The GUI opens a new Ready review instead of recognizing the transaction. The native-SegWit control correctly opens the already-known dialog. The lookup uses the unsigned transaction’s hash. For legacy and wrapped-SegWit inputs, the finalized scriptSig changes the txid, so the lookup misses the transaction already recorded by the wallet. **Expected behavior and responsibility** QML should use the finalized transaction identity and current node results to distinguish: - Already-known transactions. - Transactions that cannot currently be broadcast, with an actionable reason. - Valid replacements, identifying the affected transaction before confirmation. - Ordinary new transactions eligible for broadcast. Recheck the result when broadcasting and display any failure that occurs after review. Core’s `AnalyzePSBT` is not a current mempool-admission check. Core correctly rejects the non-admissible examples and accepts the eligible replacement. The defect is in QML’s review/broadcast integration and its already-known lookup. Spent-input, replacement, locktime, and minimum-fee cases were reproduced on the merged build at `6e54a48ab571`. The legacy/wrapped-SegWit already-known cases were reproduced at `d567e3eb2497`. All used macOS arm64, Qt 6.9.0, and disposable regtest fixtures.
Sign in to join this conversation.
No description provided.