File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4147,7 +4147,14 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
41474147 core::iter::once(funding)
41484148 .chain(pending_funding.iter())
41494149 .map(|funding| self.get_available_balances_for_scope(funding, fee_estimator))
4150- .min_by_key(|balances| balances.next_outbound_htlc_limit_msat)
4150+ .reduce(|acc, e| {
4151+ AvailableBalances {
4152+ inbound_capacity_msat: acc.inbound_capacity_msat.min(e.inbound_capacity_msat),
4153+ outbound_capacity_msat: acc.outbound_capacity_msat.min(e.outbound_capacity_msat),
4154+ next_outbound_htlc_limit_msat: acc.next_outbound_htlc_limit_msat.min(e.next_outbound_htlc_limit_msat),
4155+ next_outbound_htlc_minimum_msat: acc.next_outbound_htlc_minimum_msat.max(e.next_outbound_htlc_minimum_msat),
4156+ }
4157+ })
41514158 .expect("At least one FundingScope is always provided")
41524159 }
41534160
You can’t perform that action at this time.
0 commit comments