Skip to content

Commit 37752bf

Browse files
committed
f Panic for non-Segwit spends
1 parent 5e2a6bb commit 37752bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/access.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,13 @@ where
237237
// wallet descriptor this technically shouldn't ever happen, but better safe than sorry.
238238
for input in &psbt.inputs {
239239
if input.witness_utxo.is_none() {
240-
return Err(Error::FundingTxNonWitnessOuputSpend);
240+
log_error!(self.logger, "Tried to spend a non-witness funding output. This must not ever happen. Panicking!");
241+
panic!("Tried to spend a non-witness funding output. This must not ever happen.");
241242
}
242243
}
243244

244-
let finalized = locked_wallet.sign(&mut psbt, SignOptions::default())?;
245-
if !finalized {
246-
return Err(Error::FundingTxNotFinalized);
245+
if !locked_wallet.sign(&mut psbt, SignOptions::default())? {
246+
return Err(Error::FundingTxCreationFailed);
247247
}
248248

249249
Ok(psbt.extract_tx())

0 commit comments

Comments
 (0)