Skip to content

Commit

Permalink
Merge #1519: fix: merge Taproot sigs when updating PSBT
Browse files Browse the repository at this point in the history
86e30d2 fix: merge Taproot sigs when updating PSBT (Michael Mallan)

Pull request description:

  While testing #1513, it became apparent that Taproot signatures were not being merged properly when updating a PSBT.

  This PR fixes and refactors the code to use the `merge_signatures` function that contains the required logic.

ACKs for top commit:
  edouardparis:
    utACK 86e30d2

Tree-SHA512: ba07d8d2e612d41a3960c5ce04258775334ca22c5268d51822d4e1fbce9614424937e72e688b6006946064c3c04581c20ca2f159bb1bc2a916d98e7e1ef2dc7b
  • Loading branch information
edouardparis committed Jan 6, 2025
2 parents 1cde178 + 86e30d2 commit caa5e54
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions liana-gui/src/app/state/psbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,27 +692,7 @@ impl Action for UpdateAction {
self.success = true;
self.error = None;
let psbt = Psbt::from_str(&self.updated.value).expect("Already checked");
for (i, input) in tx.psbt.inputs.iter_mut().enumerate() {
if tx
.psbt
.unsigned_tx
.input
.get(i)
.map(|tx_in| tx_in.previous_output)
!= psbt
.unsigned_tx
.input
.get(i)
.map(|tx_in| tx_in.previous_output)
{
continue;
}
if let Some(updated_input) = psbt.inputs.get(i) {
input
.partial_sigs
.extend(updated_input.partial_sigs.clone().into_iter());
}
}
merge_signatures(&mut tx.psbt, &psbt);
tx.sigs = self
.wallet
.main_descriptor
Expand Down

0 comments on commit caa5e54

Please sign in to comment.