Skip to content

Commit 91b5843

Browse files
committed
f - account for shared input when calculating change
1 parent a21b1a6 commit 91b5843

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2960,7 +2960,7 @@ where
29602960
};
29612961
let change_value_opt = calculate_change_output_value(
29622962
&self.funding_negotiation_context,
2963-
None,
2963+
shared_funding_input.as_ref().map(|input| input.local_owned()),
29642964
&shared_funding_output.script_pubkey,
29652965
&funding_outputs,
29662966
change_script.minimal_non_dust().to_sat(),

lightning/src/ln/interactivetxs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,10 @@ impl SharedOwnedInput {
12701270
Self { input, prev_output, local_owned }
12711271
}
12721272

1273+
pub fn local_owned(&self) -> u64 {
1274+
self.local_owned
1275+
}
1276+
12731277
fn remote_owned(&self) -> u64 {
12741278
self.prev_output.value.to_sat().saturating_sub(self.local_owned)
12751279
}

0 commit comments

Comments
 (0)