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 our_funding_outputs_weight = funding_outputs. iter ( ) . fold ( 0u64 , |weight, out| {
@@ -1929,6 +1924,10 @@ pub(super) fn calculate_change_output_value(
1929
1924
if is_initiator {
1930
1925
weight = weight. saturating_add ( get_output_weight ( shared_output_funding_script) . to_wu ( ) ) ;
1931
1926
weight = weight. saturating_add ( TX_COMMON_FIELDS_WEIGHT ) ;
1927
+
1928
+ if shared_input. is_some ( ) {
1929
+ weight = weight. saturating_add ( FUNDING_TRANSACTION_WITNESS_WEIGHT ) ;
1930
+ }
1932
1931
}
1933
1932
1934
1933
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