@@ -3186,7 +3186,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
3186
3186
3187
3187
/// Allowed in any state (including after shutdown), but will return none before TheirInitSent
3188
3188
pub fn get_holder_htlc_maximum_msat(&self, funding: &FundingScope) -> Option<u64> {
3189
- self .get_htlc_maximum_msat(funding, self.holder_max_htlc_value_in_flight_msat)
3189
+ funding .get_htlc_maximum_msat(self.holder_max_htlc_value_in_flight_msat)
3190
3190
}
3191
3191
3192
3192
/// Allowed in any state (including after shutdown)
@@ -3196,19 +3196,23 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
3196
3196
3197
3197
/// Allowed in any state (including after shutdown), but will return none before TheirInitSent
3198
3198
pub fn get_counterparty_htlc_maximum_msat(&self, funding: &FundingScope) -> Option<u64> {
3199
- self .get_htlc_maximum_msat(funding, self.counterparty_max_htlc_value_in_flight_msat)
3199
+ funding .get_htlc_maximum_msat(self.counterparty_max_htlc_value_in_flight_msat)
3200
3200
}
3201
+ }
3201
3202
3202
- fn get_htlc_maximum_msat(&self, funding: &FundingScope, party_max_htlc_value_in_flight_msat: u64) -> Option<u64> {
3203
- funding.counterparty_selected_channel_reserve_satoshis.map(|counterparty_reserve| {
3204
- let holder_reserve = funding.holder_selected_channel_reserve_satoshis;
3203
+ impl FundingScope {
3204
+ fn get_htlc_maximum_msat(&self, party_max_htlc_value_in_flight_msat: u64) -> Option<u64> {
3205
+ self.counterparty_selected_channel_reserve_satoshis.map(|counterparty_reserve| {
3206
+ let holder_reserve = self.holder_selected_channel_reserve_satoshis;
3205
3207
cmp::min(
3206
- (funding .channel_value_satoshis - counterparty_reserve - holder_reserve) * 1000,
3208
+ (self .channel_value_satoshis - counterparty_reserve - holder_reserve) * 1000,
3207
3209
party_max_htlc_value_in_flight_msat
3208
3210
)
3209
3211
})
3210
3212
}
3213
+ }
3211
3214
3215
+ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
3212
3216
pub fn get_fee_proportional_millionths(&self) -> u32 {
3213
3217
self.config.options.forwarding_fee_proportional_millionths
3214
3218
}
0 commit comments