Skip to content

fix(send): broadcast reviewed psbt and show its txid - #366

Draft
reez wants to merge 1 commit into
bitcoindevkit:mainfrom
reez:fix-preview
Draft

reez wants to merge 1 commit into
bitcoindevkit:mainfrom
reez:fix-preview

Conversation

@reez

@reez reez commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Summary

The send confirmation screen shows a txid that was never broadcast, and the transaction the user reviews is not the one that gets sent.

BuildTransactionView builds a PSBT on appear to show the fee. Pressing Send then calls BDKService.send, which builds a second PSBT, then signs and broadcasts that one. The broadcast txid was never returned, so the success screen read its txid from the discarded preview PSBT.

Changes

  • BDKClient.send now takes the reviewed Psbt and returns the broadcast Txid, replacing the address, amount and fee rate arguments
  • BDKService.send no longer rebuilds the transaction
  • BuildTransactionViewModel stores the result in broadcastTxid and surfaces an error if there is no PSBT to send
  • The success screen shows and copies broadcastTxid

Why

The two builds can differ because the preview uses up a change address, so the second build gets a different one. Outputs are also shuffled, and coin selection can differ on wallets with several UTXOs.

Sending the reviewed PSBT means:

  • The displayed txid is the real one
  • The fee and total the user reviews are what gets broadcast
  • A send no longer skips a change address

Reproduction

Seen on three signet sends. The success screen showed one ID and the transaction detail screen showed another. Only the detail screen's ID exists on-chain

Notes to the reviewers

Changelog notice

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature
  • UI changes tested on small, medium, and large devices to ensure layout consistency

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@reez

reez commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

still need to test on device one last time w Send

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant