File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2296,9 +2296,12 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
22962296 };
22972297 let change_output_weight = get_output_weight(&change_output.script_pubkey).to_wu();
22982298 let change_output_fee = fee_for_weight(self.dual_funding_context.funding_feerate_sat_per_1000_weight, change_output_weight);
2299- change_output.value = Amount::from_sat(change_value.saturating_sub(change_output_fee));
2300- // Note: dust check not done here, should be handled before
2301- funding_outputs.push(OutputOwned::Single(change_output));
2299+ let change_value_decreased_with_fee = change_value.saturating_sub(change_output_fee);
2300+ // Check dust limit again
2301+ if change_value_decreased_with_fee > self.context.holder_dust_limit_satoshis {
2302+ change_output.value = Amount::from_sat(change_value_decreased_with_fee);
2303+ funding_outputs.push(OutputOwned::Single(change_output));
2304+ }
23022305 }
23032306
23042307 let constructor_args = InteractiveTxConstructorArgs {
You can’t perform that action at this time.
0 commit comments