File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1910,13 +1910,14 @@ pub(super) fn calculate_change_output_value(
1910
1910
if txin. previous_output . txid != txid {
1911
1911
return Err ( AbortReason :: PrevTxOutInvalid ) ;
1912
1912
}
1913
- if let Some ( output) = tx. as_transaction ( ) . output . get ( txin. previous_output . vout as usize ) {
1914
- total_input_satoshis = total_input_satoshis. saturating_add ( output. value . to_sat ( ) ) ;
1915
- let weight = estimate_input_weight ( output) . to_wu ( ) ;
1916
- our_funding_inputs_weight = our_funding_inputs_weight. saturating_add ( weight) ;
1917
- } else {
1918
- return Err ( AbortReason :: PrevTxOutInvalid ) ;
1919
- }
1913
+ let output = tx
1914
+ . as_transaction ( )
1915
+ . output
1916
+ . get ( txin. previous_output . vout as usize )
1917
+ . ok_or ( AbortReason :: PrevTxOutInvalid ) ?;
1918
+ total_input_satoshis = total_input_satoshis. saturating_add ( output. value . to_sat ( ) ) ;
1919
+ let weight = estimate_input_weight ( output) . to_wu ( ) ;
1920
+ our_funding_inputs_weight = our_funding_inputs_weight. saturating_add ( weight) ;
1920
1921
}
1921
1922
// If there is a shared input, account for it,
1922
1923
// and for the initiator also consider the fee
You can’t perform that action at this time.
0 commit comments