Skip to content

Commit b3af7b7

Browse files
committed
f Check for witness output differently
We can't check that `non_witness_utxo` is never `Some(..)` since the `TxBuilder` might populate both `witness_utxo` and `non_witness_utxo` to mitigate the "SegWit bug".
1 parent 775362d commit b3af7b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/access.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,12 @@ where
245245
tx_builder.add_recipient(output_script.clone(), value_sats).fee_rate(fee_rate).enable_rbf();
246246

247247
let (mut psbt, _) = tx_builder.finish()?;
248+
log_trace!(self.logger, "Created funding PSBT: {:?}", psbt);
248249

249250
// We double-check that no inputs try to spend non-witness outputs. As we use a SegWit
250-
// wallet descriptor this technically can't ever happen, but better safe than sorry.
251+
// wallet descriptor this technically shouldn't ever happen, but better safe than sorry.
251252
for input in &psbt.inputs {
252-
if input.non_witness_utxo.is_some() {
253+
if input.witness_utxo.is_none() {
253254
return Err(Error::FundingTxNonWitnessOuputSpend);
254255
}
255256
}

0 commit comments

Comments
 (0)