File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1909,14 +1909,9 @@ pub(super) fn calculate_change_output_value(
1909
1909
let weight = estimate_input_weight ( output) . to_wu ( ) ;
1910
1910
our_funding_inputs_weight = our_funding_inputs_weight. saturating_add ( weight) ;
1911
1911
}
1912
- // If there is a shared input, account for it,
1913
- // and for the initiator also consider the fee
1912
+
1914
1913
if let Some ( shared_input) = shared_input {
1915
1914
total_input_satoshis = total_input_satoshis. saturating_add ( shared_input) ;
1916
- if is_initiator {
1917
- our_funding_inputs_weight =
1918
- our_funding_inputs_weight. saturating_add ( FUNDING_TRANSACTION_WITNESS_WEIGHT ) ;
1919
- }
1920
1915
}
1921
1916
1922
1917
let total_output_satoshis = funding_outputs. iter ( ) . fold ( 0u64 , |total, out| {
@@ -1932,6 +1927,10 @@ pub(super) fn calculate_change_output_value(
1932
1927
if is_initiator {
1933
1928
weight = weight. saturating_add ( get_output_weight ( shared_output_funding_script) . to_wu ( ) ) ;
1934
1929
weight = weight. saturating_add ( TX_COMMON_FIELDS_WEIGHT ) ;
1930
+
1931
+ if shared_input. is_some ( ) {
1932
+ weight = weight. saturating_add ( FUNDING_TRANSACTION_WITNESS_WEIGHT ) ;
1933
+ }
1935
1934
}
1936
1935
1937
1936
let fees_sats = fee_for_weight ( funding_feerate_sat_per_1000_weight, weight) ;
You can’t perform that action at this time.
0 commit comments