Skip to content

Commit 3ecd0f2

Browse files
jkczyzbenthecarman
authored andcommitted
f - extract_tx
1 parent a0bd38f commit 3ecd0f2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/wallet/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,14 @@ impl Wallet {
690690
},
691691
}
692692

693-
let mut tx = psbt.unsigned_tx;
694-
for (txin, input) in tx.input.iter_mut().zip(psbt.inputs.into_iter()) {
695-
txin.witness = input.final_script_witness.unwrap_or_default();
693+
match psbt.extract_tx() {
694+
Ok(tx) => Ok(tx),
695+
Err(bitcoin::psbt::ExtractTxError::MissingInputValue { tx }) => Ok(tx),
696+
Err(e) => {
697+
log_error!(self.logger, "Failed to extract transaction: {}", e);
698+
Err(())
699+
}
696700
}
697-
698-
Ok(tx)
699701
}
700702

701703
#[allow(deprecated)]

0 commit comments

Comments
 (0)