@@ -1059,7 +1059,10 @@ impl<Signer: ChannelSigner> ChannelContext<Signer> {
1059
1059
cmp::max(self.config.options.cltv_expiry_delta, MIN_CLTV_EXPIRY_DELTA)
1060
1060
}
1061
1061
1062
- pub fn get_max_dust_htlc_exposure_msat ( & self ) -> u64 {
1062
+ pub fn get_max_dust_htlc_exposure_msat<F: Deref>(&self,
1063
+ _fee_estimator: &LowerBoundedFeeEstimator<F>) -> u64
1064
+ where F::Target: FeeEstimator
1065
+ {
1063
1066
match self.config.options.max_dust_htlc_exposure_msat {
1064
1067
MaxDustHTLCExposure::FixedLimitMsat(limit) => limit,
1065
1068
MaxDustHTLCExposure::FeeRateMultiplier(_) => 5_000_000,
@@ -1536,7 +1539,9 @@ impl<Signer: ChannelSigner> ChannelContext<Signer> {
1536
1539
/// Doesn't bother handling the
1537
1540
/// if-we-removed-it-already-but-haven't-fully-resolved-they-can-still-send-an-inbound-HTLC
1538
1541
/// corner case properly.
1539
- pub fn get_available_balances ( & self ) -> AvailableBalances {
1542
+ pub fn get_available_balances<F: Deref>(&self, fee_estimator: &LowerBoundedFeeEstimator<F>) -> AvailableBalances
1543
+ where F::Target: FeeEstimator
1544
+ {
1540
1545
let context = &self;
1541
1546
// Note that we have to handle overflow due to the above case.
1542
1547
let inbound_stats = context.get_inbound_pending_htlc_stats(None);
@@ -1618,6 +1623,7 @@ impl<Signer: ChannelSigner> ChannelContext<Signer> {
1618
1623
// send above the dust limit (as the router can always overpay to meet the dust limit).
1619
1624
let mut remaining_msat_below_dust_exposure_limit = None;
1620
1625
let mut dust_exposure_dust_limit_msat = 0;
1626
+ let max_dust_htlc_exposure_msat = context.get_max_dust_htlc_exposure_msat(fee_estimator);
1621
1627
1622
1628
let (htlc_success_dust_limit, htlc_timeout_dust_limit) = if context.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
1623
1629
(context.counterparty_dust_limit_satoshis, context.holder_dust_limit_satoshis)
@@ -1627,17 +1633,17 @@ impl<Signer: ChannelSigner> ChannelContext<Signer> {
1627
1633
context.holder_dust_limit_satoshis + dust_buffer_feerate * htlc_timeout_tx_weight(context.get_channel_type()) / 1000)
1628
1634
};
1629
1635
let on_counterparty_dust_htlc_exposure_msat = inbound_stats.on_counterparty_tx_dust_exposure_msat + outbound_stats.on_counterparty_tx_dust_exposure_msat;
1630
- if on_counterparty_dust_htlc_exposure_msat as i64 + htlc_success_dust_limit as i64 * 1000 - 1 > context . get_max_dust_htlc_exposure_msat ( ) as i64 {
1636
+ if on_counterparty_dust_htlc_exposure_msat as i64 + htlc_success_dust_limit as i64 * 1000 - 1 > max_dust_htlc_exposure_msat as i64 {
1631
1637
remaining_msat_below_dust_exposure_limit =
1632
- Some ( context . get_max_dust_htlc_exposure_msat ( ) . saturating_sub ( on_counterparty_dust_htlc_exposure_msat) ) ;
1638
+ Some(max_dust_htlc_exposure_msat .saturating_sub(on_counterparty_dust_htlc_exposure_msat));
1633
1639
dust_exposure_dust_limit_msat = cmp::max(dust_exposure_dust_limit_msat, htlc_success_dust_limit * 1000);
1634
1640
}
1635
1641
1636
1642
let on_holder_dust_htlc_exposure_msat = inbound_stats.on_holder_tx_dust_exposure_msat + outbound_stats.on_holder_tx_dust_exposure_msat;
1637
- if on_holder_dust_htlc_exposure_msat as i64 + htlc_timeout_dust_limit as i64 * 1000 - 1 > context . get_max_dust_htlc_exposure_msat ( ) as i64 {
1643
+ if on_holder_dust_htlc_exposure_msat as i64 + htlc_timeout_dust_limit as i64 * 1000 - 1 > max_dust_htlc_exposure_msat as i64 {
1638
1644
remaining_msat_below_dust_exposure_limit = Some(cmp::min(
1639
1645
remaining_msat_below_dust_exposure_limit.unwrap_or(u64::max_value()),
1640
- context . get_max_dust_htlc_exposure_msat ( ) . saturating_sub ( on_holder_dust_htlc_exposure_msat) ) ) ;
1646
+ max_dust_htlc_exposure_msat .saturating_sub(on_holder_dust_htlc_exposure_msat)));
1641
1647
dust_exposure_dust_limit_msat = cmp::max(dust_exposure_dust_limit_msat, htlc_timeout_dust_limit * 1000);
1642
1648
}
1643
1649
@@ -2555,8 +2561,9 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2555
2561
Ok(self.get_announcement_sigs(node_signer, genesis_block_hash, user_config, best_block.height(), logger))
2556
2562
}
2557
2563
2558
- pub fn update_add_htlc < F , L : Deref > ( & mut self , msg : & msgs:: UpdateAddHTLC , mut pending_forward_status : PendingHTLCStatus , create_pending_htlc_status : F , logger : & L ) -> Result < ( ) , ChannelError >
2559
- where F : for < ' a > Fn ( & ' a Self , PendingHTLCStatus , u16 ) -> PendingHTLCStatus , L :: Target : Logger {
2564
+ pub fn update_add_htlc<F, FE: Deref, L: Deref>(&mut self, msg: &msgs::UpdateAddHTLC, mut pending_forward_status: PendingHTLCStatus, create_pending_htlc_status: F, fee_estimator: &LowerBoundedFeeEstimator<FE>, logger: &L) -> Result<(), ChannelError>
2565
+ where F: for<'a> Fn(&'a Self, PendingHTLCStatus, u16) -> PendingHTLCStatus,
2566
+ FE::Target: FeeEstimator, L::Target: Logger {
2560
2567
// We can't accept HTLCs sent after we've sent a shutdown.
2561
2568
let local_sent_shutdown = (self.context.channel_state & (ChannelState::ChannelReady as u32 | ChannelState::LocalShutdownSent as u32)) != (ChannelState::ChannelReady as u32);
2562
2569
if local_sent_shutdown {
@@ -2609,6 +2616,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2609
2616
}
2610
2617
}
2611
2618
2619
+ let max_dust_htlc_exposure_msat = self.context.get_max_dust_htlc_exposure_msat(fee_estimator);
2612
2620
let (htlc_timeout_dust_limit, htlc_success_dust_limit) = if self.context.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
2613
2621
(0, 0)
2614
2622
} else {
@@ -2619,19 +2627,19 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2619
2627
let exposure_dust_limit_timeout_sats = htlc_timeout_dust_limit + self.context.counterparty_dust_limit_satoshis;
2620
2628
if msg.amount_msat / 1000 < exposure_dust_limit_timeout_sats {
2621
2629
let on_counterparty_tx_dust_htlc_exposure_msat = inbound_stats.on_counterparty_tx_dust_exposure_msat + outbound_stats.on_counterparty_tx_dust_exposure_msat + msg.amount_msat;
2622
- if on_counterparty_tx_dust_htlc_exposure_msat > self . context . get_max_dust_htlc_exposure_msat ( ) {
2630
+ if on_counterparty_tx_dust_htlc_exposure_msat > max_dust_htlc_exposure_msat {
2623
2631
log_info!(logger, "Cannot accept value that would put our exposure to dust HTLCs at {} over the limit {} on counterparty commitment tx",
2624
- on_counterparty_tx_dust_htlc_exposure_msat, self . context . get_max_dust_htlc_exposure_msat ( ) ) ;
2632
+ on_counterparty_tx_dust_htlc_exposure_msat, max_dust_htlc_exposure_msat );
2625
2633
pending_forward_status = create_pending_htlc_status(self, pending_forward_status, 0x1000|7);
2626
2634
}
2627
2635
}
2628
2636
2629
2637
let exposure_dust_limit_success_sats = htlc_success_dust_limit + self.context.holder_dust_limit_satoshis;
2630
2638
if msg.amount_msat / 1000 < exposure_dust_limit_success_sats {
2631
2639
let on_holder_tx_dust_htlc_exposure_msat = inbound_stats.on_holder_tx_dust_exposure_msat + outbound_stats.on_holder_tx_dust_exposure_msat + msg.amount_msat;
2632
- if on_holder_tx_dust_htlc_exposure_msat > self . context . get_max_dust_htlc_exposure_msat ( ) {
2640
+ if on_holder_tx_dust_htlc_exposure_msat > max_dust_htlc_exposure_msat {
2633
2641
log_info!(logger, "Cannot accept value that would put our exposure to dust HTLCs at {} over the limit {} on holder commitment tx",
2634
- on_holder_tx_dust_htlc_exposure_msat, self . context . get_max_dust_htlc_exposure_msat ( ) ) ;
2642
+ on_holder_tx_dust_htlc_exposure_msat, max_dust_htlc_exposure_msat );
2635
2643
pending_forward_status = create_pending_htlc_status(self, pending_forward_status, 0x1000|7);
2636
2644
}
2637
2645
}
@@ -2998,16 +3006,18 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2998
3006
/// Public version of the below, checking relevant preconditions first.
2999
3007
/// If we're not in a state where freeing the holding cell makes sense, this is a no-op and
3000
3008
/// returns `(None, Vec::new())`.
3001
- pub fn maybe_free_holding_cell_htlcs < L : Deref > ( & mut self , logger : & L ) -> ( Option < ChannelMonitorUpdate > , Vec < ( HTLCSource , PaymentHash ) > ) where L :: Target : Logger {
3009
+ pub fn maybe_free_holding_cell_htlcs<F: Deref, L: Deref>(&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L) -> (Option<ChannelMonitorUpdate>, Vec<(HTLCSource, PaymentHash)>) where F::Target: FeeEstimator, L::Target: Logger {
3002
3010
if self.context.channel_state >= ChannelState::ChannelReady as u32 &&
3003
3011
(self.context.channel_state & (ChannelState::AwaitingRemoteRevoke as u32 | ChannelState::PeerDisconnected as u32 | ChannelState::MonitorUpdateInProgress as u32)) == 0 {
3004
- self . free_holding_cell_htlcs ( logger)
3012
+ self.free_holding_cell_htlcs(fee_estimator, logger)
3005
3013
} else { (None, Vec::new()) }
3006
3014
}
3007
3015
3008
3016
/// Frees any pending commitment updates in the holding cell, generating the relevant messages
3009
3017
/// for our counterparty.
3010
- fn free_holding_cell_htlcs < L : Deref > ( & mut self , logger : & L ) -> ( Option < ChannelMonitorUpdate > , Vec < ( HTLCSource , PaymentHash ) > ) where L :: Target : Logger {
3018
+ fn free_holding_cell_htlcs<F: Deref, L: Deref>(&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L) -> (Option<ChannelMonitorUpdate>, Vec<(HTLCSource, PaymentHash)>)
3019
+ where F::Target: FeeEstimator, L::Target: Logger
3020
+ {
3011
3021
assert_eq!(self.context.channel_state & ChannelState::MonitorUpdateInProgress as u32, 0);
3012
3022
if self.context.holding_cell_htlc_updates.len() != 0 || self.context.holding_cell_update_fee.is_some() {
3013
3023
log_trace!(logger, "Freeing holding cell with {} HTLC updates{} in channel {}", self.context.holding_cell_htlc_updates.len(),
@@ -3036,7 +3046,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3036
3046
skimmed_fee_msat, ..
3037
3047
} => {
3038
3048
match self.send_htlc(amount_msat, *payment_hash, cltv_expiry, source.clone(),
3039
- onion_routing_packet. clone ( ) , false , skimmed_fee_msat, logger)
3049
+ onion_routing_packet.clone(), false, skimmed_fee_msat, fee_estimator, logger)
3040
3050
{
3041
3051
Ok(update_add_msg_option) => update_add_htlcs.push(update_add_msg_option.unwrap()),
3042
3052
Err(e) => {
@@ -3096,7 +3106,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3096
3106
return (None, htlcs_to_fail);
3097
3107
}
3098
3108
let update_fee = if let Some(feerate) = self.context.holding_cell_update_fee.take() {
3099
- self . send_update_fee ( feerate, false , logger)
3109
+ self.send_update_fee(feerate, false, fee_estimator, logger)
3100
3110
} else {
3101
3111
None
3102
3112
};
@@ -3123,8 +3133,8 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3123
3133
/// waiting on this revoke_and_ack. The generation of this new commitment_signed may also fail,
3124
3134
/// generating an appropriate error *after* the channel state has been updated based on the
3125
3135
/// revoke_and_ack message.
3126
- pub fn revoke_and_ack < L : Deref > ( & mut self , msg : & msgs:: RevokeAndACK , logger : & L ) -> Result < ( Vec < ( HTLCSource , PaymentHash ) > , Option < ChannelMonitorUpdate > ) , ChannelError >
3127
- where L :: Target : Logger ,
3136
+ pub fn revoke_and_ack<F: Deref, L: Deref>(&mut self, msg: &msgs::RevokeAndACK, fee_estimator: &LowerBoundedFeeEstimator<F> , logger: &L) -> Result<(Vec<(HTLCSource, PaymentHash)>, Option<ChannelMonitorUpdate>), ChannelError>
3137
+ where F::Target: FeeEstimator, L::Target: Logger,
3128
3138
{
3129
3139
if (self.context.channel_state & (ChannelState::ChannelReady as u32)) != (ChannelState::ChannelReady as u32) {
3130
3140
return Err(ChannelError::Close("Got revoke/ACK message when channel was not in an operational state".to_owned()));
@@ -3324,7 +3334,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3324
3334
return Ok((Vec::new(), self.push_ret_blockable_mon_update(monitor_update)));
3325
3335
}
3326
3336
3327
- match self . free_holding_cell_htlcs ( logger) {
3337
+ match self.free_holding_cell_htlcs(fee_estimator, logger) {
3328
3338
(Some(mut additional_update), htlcs_to_fail) => {
3329
3339
// free_holding_cell_htlcs may bump latest_monitor_id multiple times but we want them to be
3330
3340
// strictly increasing by one, so decrement it here.
@@ -3359,8 +3369,11 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3359
3369
/// Queues up an outbound update fee by placing it in the holding cell. You should call
3360
3370
/// [`Self::maybe_free_holding_cell_htlcs`] in order to actually generate and send the
3361
3371
/// commitment update.
3362
- pub fn queue_update_fee < L : Deref > ( & mut self , feerate_per_kw : u32 , logger : & L ) where L :: Target : Logger {
3363
- let msg_opt = self . send_update_fee ( feerate_per_kw, true , logger) ;
3372
+ pub fn queue_update_fee<F: Deref, L: Deref>(&mut self, feerate_per_kw: u32,
3373
+ fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L)
3374
+ where F::Target: FeeEstimator, L::Target: Logger
3375
+ {
3376
+ let msg_opt = self.send_update_fee(feerate_per_kw, true, fee_estimator, logger);
3364
3377
assert!(msg_opt.is_none(), "We forced holding cell?");
3365
3378
}
3366
3379
@@ -3371,7 +3384,9 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3371
3384
///
3372
3385
/// You MUST call [`Self::send_commitment_no_state_update`] prior to any other calls on this
3373
3386
/// [`Channel`] if `force_holding_cell` is false.
3374
- fn send_update_fee < L : Deref > ( & mut self , feerate_per_kw : u32 , mut force_holding_cell : bool , logger : & L ) -> Option < msgs:: UpdateFee > where L :: Target : Logger {
3387
+ fn send_update_fee<F: Deref, L: Deref>(&mut self, feerate_per_kw: u32, mut force_holding_cell: bool, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L) -> Option<msgs::UpdateFee>
3388
+ where F::Target: FeeEstimator, L::Target: Logger
3389
+ {
3375
3390
if !self.context.is_outbound() {
3376
3391
panic!("Cannot send fee from inbound channel");
3377
3392
}
@@ -3398,11 +3413,12 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3398
3413
// Note, we evaluate pending htlc "preemptive" trimmed-to-dust threshold at the proposed `feerate_per_kw`.
3399
3414
let holder_tx_dust_exposure = inbound_stats.on_holder_tx_dust_exposure_msat + outbound_stats.on_holder_tx_dust_exposure_msat;
3400
3415
let counterparty_tx_dust_exposure = inbound_stats.on_counterparty_tx_dust_exposure_msat + outbound_stats.on_counterparty_tx_dust_exposure_msat;
3401
- if holder_tx_dust_exposure > self . context . get_max_dust_htlc_exposure_msat ( ) {
3416
+ let max_dust_htlc_exposure_msat = self.context.get_max_dust_htlc_exposure_msat(fee_estimator);
3417
+ if holder_tx_dust_exposure > max_dust_htlc_exposure_msat {
3402
3418
log_debug!(logger, "Cannot afford to send new feerate at {} without infringing max dust htlc exposure", feerate_per_kw);
3403
3419
return None;
3404
3420
}
3405
- if counterparty_tx_dust_exposure > self . context . get_max_dust_htlc_exposure_msat ( ) {
3421
+ if counterparty_tx_dust_exposure > max_dust_htlc_exposure_msat {
3406
3422
log_debug!(logger, "Cannot afford to send new feerate at {} without infringing max dust htlc exposure", feerate_per_kw);
3407
3423
return None;
3408
3424
}
@@ -3633,11 +3649,12 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3633
3649
let outbound_stats = self.context.get_outbound_pending_htlc_stats(None);
3634
3650
let holder_tx_dust_exposure = inbound_stats.on_holder_tx_dust_exposure_msat + outbound_stats.on_holder_tx_dust_exposure_msat;
3635
3651
let counterparty_tx_dust_exposure = inbound_stats.on_counterparty_tx_dust_exposure_msat + outbound_stats.on_counterparty_tx_dust_exposure_msat;
3636
- if holder_tx_dust_exposure > self . context . get_max_dust_htlc_exposure_msat ( ) {
3652
+ let max_dust_htlc_exposure_msat = self.context.get_max_dust_htlc_exposure_msat(fee_estimator);
3653
+ if holder_tx_dust_exposure > max_dust_htlc_exposure_msat {
3637
3654
return Err(ChannelError::Close(format!("Peer sent update_fee with a feerate ({}) which may over-expose us to dust-in-flight on our own transactions (totaling {} msat)",
3638
3655
msg.feerate_per_kw, holder_tx_dust_exposure)));
3639
3656
}
3640
- if counterparty_tx_dust_exposure > self . context . get_max_dust_htlc_exposure_msat ( ) {
3657
+ if counterparty_tx_dust_exposure > max_dust_htlc_exposure_msat {
3641
3658
return Err(ChannelError::Close(format!("Peer sent update_fee with a feerate ({}) which may over-expose us to dust-in-flight on our counterparty's transactions (totaling {} msat)",
3642
3659
msg.feerate_per_kw, counterparty_tx_dust_exposure)));
3643
3660
}
@@ -4991,13 +5008,16 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4991
5008
/// commitment update.
4992
5009
///
4993
5010
/// `Err`s will only be [`ChannelError::Ignore`].
4994
- pub fn queue_add_htlc < L : Deref > (
5011
+ pub fn queue_add_htlc<F: Deref, L: Deref>(
4995
5012
&mut self, amount_msat: u64, payment_hash: PaymentHash, cltv_expiry: u32, source: HTLCSource,
4996
- onion_routing_packet : msgs:: OnionPacket , skimmed_fee_msat : Option < u64 > , logger : & L
4997
- ) -> Result < ( ) , ChannelError > where L :: Target : Logger {
5013
+ onion_routing_packet: msgs::OnionPacket, skimmed_fee_msat: Option<u64>,
5014
+ fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
5015
+ ) -> Result<(), ChannelError>
5016
+ where F::Target: FeeEstimator, L::Target: Logger
5017
+ {
4998
5018
self
4999
5019
.send_htlc(amount_msat, payment_hash, cltv_expiry, source, onion_routing_packet, true,
5000
- skimmed_fee_msat, logger)
5020
+ skimmed_fee_msat, fee_estimator, logger)
5001
5021
.map(|msg_opt| assert!(msg_opt.is_none(), "We forced holding cell?"))
5002
5022
.map_err(|err| {
5003
5023
if let ChannelError::Ignore(_) = err { /* fine */ }
@@ -5022,11 +5042,13 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
5022
5042
/// on this [`Channel`] if `force_holding_cell` is false.
5023
5043
///
5024
5044
/// `Err`s will only be [`ChannelError::Ignore`].
5025
- fn send_htlc < L : Deref > (
5045
+ fn send_htlc<F: Deref, L: Deref>(
5026
5046
&mut self, amount_msat: u64, payment_hash: PaymentHash, cltv_expiry: u32, source: HTLCSource,
5027
5047
onion_routing_packet: msgs::OnionPacket, mut force_holding_cell: bool,
5028
- skimmed_fee_msat : Option < u64 > , logger : & L
5029
- ) -> Result < Option < msgs:: UpdateAddHTLC > , ChannelError > where L :: Target : Logger {
5048
+ skimmed_fee_msat: Option<u64>, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
5049
+ ) -> Result<Option<msgs::UpdateAddHTLC>, ChannelError>
5050
+ where F::Target: FeeEstimator, L::Target: Logger
5051
+ {
5030
5052
if (self.context.channel_state & (ChannelState::ChannelReady as u32 | BOTH_SIDES_SHUTDOWN_MASK)) != (ChannelState::ChannelReady as u32) {
5031
5053
return Err(ChannelError::Ignore("Cannot send HTLC until channel is fully established and we haven't started shutting down".to_owned()));
5032
5054
}
@@ -5039,7 +5061,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
5039
5061
return Err(ChannelError::Ignore("Cannot send 0-msat HTLC".to_owned()));
5040
5062
}
5041
5063
5042
- let available_balances = self . context . get_available_balances ( ) ;
5064
+ let available_balances = self.context.get_available_balances(fee_estimator );
5043
5065
if amount_msat < available_balances.next_outbound_htlc_minimum_msat {
5044
5066
return Err(ChannelError::Ignore(format!("Cannot send less than our next-HTLC minimum - {} msat",
5045
5067
available_balances.next_outbound_htlc_minimum_msat)));
@@ -5239,12 +5261,15 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
5239
5261
///
5240
5262
/// Shorthand for calling [`Self::send_htlc`] followed by a commitment update, see docs on
5241
5263
/// [`Self::send_htlc`] and [`Self::build_commitment_no_state_update`] for more info.
5242
- pub fn send_htlc_and_commit < L : Deref > (
5264
+ pub fn send_htlc_and_commit<F: Deref, L: Deref>(
5243
5265
&mut self, amount_msat: u64, payment_hash: PaymentHash, cltv_expiry: u32, source: HTLCSource,
5244
- onion_routing_packet : msgs:: OnionPacket , skimmed_fee_msat : Option < u64 > , logger : & L
5245
- ) -> Result < Option < ChannelMonitorUpdate > , ChannelError > where L :: Target : Logger {
5266
+ onion_routing_packet: msgs::OnionPacket, skimmed_fee_msat: Option<u64>,
5267
+ fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
5268
+ ) -> Result<Option<ChannelMonitorUpdate>, ChannelError>
5269
+ where F::Target: FeeEstimator, L::Target: Logger
5270
+ {
5246
5271
let send_res = self.send_htlc(amount_msat, payment_hash, cltv_expiry, source,
5247
- onion_routing_packet, false , skimmed_fee_msat, logger) ;
5272
+ onion_routing_packet, false, skimmed_fee_msat, fee_estimator, logger);
5248
5273
if let Err(e) = &send_res { if let ChannelError::Ignore(_) = e {} else { debug_assert!(false, "Sending cannot trigger channel failure"); } }
5249
5274
match send_res? {
5250
5275
Some(_) => {
0 commit comments