@@ -3165,7 +3165,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
3165
3165
3166
3166
/// Allowed in any state (including after shutdown), but will return none before TheirInitSent
3167
3167
pub fn get_holder_htlc_maximum_msat(&self, funding: &FundingScope) -> Option<u64> {
3168
- self .get_htlc_maximum_msat(funding, self.holder_max_htlc_value_in_flight_msat)
3168
+ funding .get_htlc_maximum_msat(self.holder_max_htlc_value_in_flight_msat)
3169
3169
}
3170
3170
3171
3171
/// Allowed in any state (including after shutdown)
@@ -3175,19 +3175,23 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
3175
3175
3176
3176
/// Allowed in any state (including after shutdown), but will return none before TheirInitSent
3177
3177
pub fn get_counterparty_htlc_maximum_msat(&self, funding: &FundingScope) -> Option<u64> {
3178
- self .get_htlc_maximum_msat(funding, self.counterparty_max_htlc_value_in_flight_msat)
3178
+ funding .get_htlc_maximum_msat(self.counterparty_max_htlc_value_in_flight_msat)
3179
3179
}
3180
+ }
3180
3181
3181
- fn get_htlc_maximum_msat(&self, funding: &FundingScope, party_max_htlc_value_in_flight_msat: u64) -> Option<u64> {
3182
- funding.counterparty_selected_channel_reserve_satoshis.map(|counterparty_reserve| {
3183
- let holder_reserve = funding.holder_selected_channel_reserve_satoshis;
3182
+ impl FundingScope {
3183
+ fn get_htlc_maximum_msat(&self, party_max_htlc_value_in_flight_msat: u64) -> Option<u64> {
3184
+ self.counterparty_selected_channel_reserve_satoshis.map(|counterparty_reserve| {
3185
+ let holder_reserve = self.holder_selected_channel_reserve_satoshis;
3184
3186
cmp::min(
3185
- (funding .channel_value_satoshis - counterparty_reserve - holder_reserve) * 1000,
3187
+ (self .channel_value_satoshis - counterparty_reserve - holder_reserve) * 1000,
3186
3188
party_max_htlc_value_in_flight_msat
3187
3189
)
3188
3190
})
3189
3191
}
3192
+ }
3190
3193
3194
+ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
3191
3195
pub fn get_fee_proportional_millionths(&self) -> u32 {
3192
3196
self.config.options.forwarding_fee_proportional_millionths
3193
3197
}
0 commit comments