Skip to content

Commit 5562356

Browse files
committed
f - simplify check
1 parent 8f1f2ec commit 5562356

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lightning/src/ln/interactivetxs.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -677,15 +677,13 @@ impl NegotiationContext {
677677
if self.inputs.values().any(|input| matches!(input.input, InputOwned::Shared(_))) {
678678
return Err(AbortReason::DuplicateFundingInput);
679679
}
680-
// Check if received shared input matches the expected
681-
if !(shared_funding_input.input.previous_output.txid == *shared_txid
682-
&& shared_funding_input.input.previous_output.vout == msg.prevtx_out)
683-
{
680+
681+
let previous_output = OutPoint { txid: *shared_txid, vout: msg.prevtx_out };
682+
if previous_output != shared_funding_input.input.previous_output {
684683
return Err(AbortReason::UnexpectedFundingInput);
685-
} else {
686-
let previous_output = OutPoint { txid: *shared_txid, vout: msg.prevtx_out };
687-
(InputOwned::Shared(shared_funding_input.clone()), previous_output)
688684
}
685+
686+
(InputOwned::Shared(shared_funding_input.clone()), previous_output)
689687
} else {
690688
return Err(AbortReason::UnexpectedFundingInput);
691689
}

0 commit comments

Comments
 (0)