combine_psbt silently drops PSBTs that fail to combine (exit 0, incomplete output)

Aperta
#323 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@tvpeter ci sta già lavorando.

Dal 16/9/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug

Describe the bug

bdk-cli wallet … combine_psbt discards the error from Psbt::combine, so when two PSBTs are incompatible (different unsigned transactions) the command exits 0 and prints a "combined" PSBT that is silently missing the other PSBT's inputs/signatures, instead of failing.

The fold that merges the PSBTs discards each combine result:

let final_psbt = psbts.into_iter().try_fold::<_, _, Result<Psbt, Error>>(
    init_psbt,
    |mut acc, x| {
        let _ = acc.combine(x);   // error dropped here
        Ok(acc)
    },
)?;

Per BIP174, Psbt::combine returns Err whenever the two PSBTs don't describe the same unsigned transaction (different txids/outputs).

To Reproduce

Two PSBTs with different unsigned transactions (BIP174-incompatible):

 bdk-cli wallet -w demo combine_psbt $A $B
# exit 0; output == B, with A silently dropped

 bdk-cli wallet -w demo combine_psbt $A $A
# control: valid combine, output == A

Expected behavior

  • non-zero exit and an error explaining the PSBTs could not be combined.

Build environment

  • BDK-CLI tag/commit: bdk-cli v4.0.0 bdk-cli 5b3cb000cfa09b91eb7660d0aa50bf6646cc5d7a

Additional context

Lingua principale
Rust
Stelle
142
Fork
99
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bitcoindevkit/bdk-cli

Tutte le issue di bitcoindevkit/bdk-cli

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.