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