@@ -684,6 +684,7 @@ pub(super) struct ChannelContext<Signer: ChannelSigner> {
684
684
next_holder_htlc_id : u64 ,
685
685
next_counterparty_htlc_id : u64 ,
686
686
feerate_per_kw : u32 ,
687
+ high_priority_feerate_per_kw : Option < u32 > ,
687
688
688
689
/// The timestamp set on our latest `channel_update` message for this channel. It is updated
689
690
/// when the channel is updated in ways which may impact the `channel_update` message or when a
@@ -1073,6 +1074,11 @@ impl<Signer: ChannelSigner> ChannelContext<Signer> {
1073
1074
self . config . options . max_dust_htlc_exposure_msat
1074
1075
}
1075
1076
1077
+ /// Sets the channel's high priority feerate per kw.
1078
+ pub fn update_high_priority_feerate ( & mut self , high_priority_feerate_per_kw : u32 ) {
1079
+ self . high_priority_feerate_per_kw = Some ( high_priority_feerate_per_kw) ;
1080
+ }
1081
+
1076
1082
/// Returns the previous [`ChannelConfig`] applied to this channel, if any.
1077
1083
pub fn prev_config ( & self ) -> Option < ChannelConfig > {
1078
1084
self . prev_config . map ( |prev_config| prev_config. 0 )
@@ -5473,6 +5479,7 @@ impl<Signer: WriteableEcdsaChannelSigner> OutboundV1Channel<Signer> {
5473
5479
debug_assert ! ( channel_type. is_subset( & channelmanager:: provided_channel_type_features( & config) ) ) ;
5474
5480
5475
5481
let feerate = fee_estimator. bounded_sat_per_1000_weight ( ConfirmationTarget :: Normal ) ;
5482
+ let high_priority_feerate = fee_estimator. bounded_sat_per_1000_weight ( ConfirmationTarget :: HighPriority ) ;
5476
5483
5477
5484
let value_to_self_msat = channel_value_satoshis * 1000 - push_msat;
5478
5485
let commitment_tx_fee = commit_tx_fee_msat ( feerate, MIN_AFFORDABLE_HTLC_COUNT , channel_type. requires_anchors_zero_fee_htlc_tx ( ) ) ;
@@ -5570,6 +5577,7 @@ impl<Signer: WriteableEcdsaChannelSigner> OutboundV1Channel<Signer> {
5570
5577
channel_creation_height : current_chain_height,
5571
5578
5572
5579
feerate_per_kw : feerate,
5580
+ high_priority_feerate_per_kw : Some ( high_priority_feerate) ,
5573
5581
counterparty_dust_limit_satoshis : 0 ,
5574
5582
holder_dust_limit_satoshis : MIN_CHAN_DUST_LIMIT_SATOSHIS ,
5575
5583
counterparty_max_htlc_value_in_flight_msat : 0 ,
@@ -6196,6 +6204,7 @@ impl<Signer: WriteableEcdsaChannelSigner> InboundV1Channel<Signer> {
6196
6204
channel_creation_height : current_chain_height,
6197
6205
6198
6206
feerate_per_kw : msg. feerate_per_kw ,
6207
+ high_priority_feerate_per_kw : Some ( fee_estimator. bounded_sat_per_1000_weight ( ConfirmationTarget :: HighPriority ) ) ,
6199
6208
channel_value_satoshis : msg. funding_satoshis ,
6200
6209
counterparty_dust_limit_satoshis : msg. dust_limit_satoshis ,
6201
6210
holder_dust_limit_satoshis : MIN_CHAN_DUST_LIMIT_SATOSHIS ,
@@ -7102,6 +7111,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
7102
7111
let mut holder_max_accepted_htlcs: Option < u16 > = None ;
7103
7112
7104
7113
let mut pending_monitor_updates = Some ( Vec :: new ( ) ) ;
7114
+ let mut high_priority_feerate_per_kw = None ;
7105
7115
7106
7116
read_tlv_fields ! ( reader, {
7107
7117
( 0 , announcement_sigs, option) ,
@@ -7126,6 +7136,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
7126
7136
( 29 , temporary_channel_id, option) ,
7127
7137
( 31 , channel_pending_event_emitted, option) ,
7128
7138
( 33 , pending_monitor_updates, vec_type) ,
7139
+ ( 35 , high_priority_feerate_per_kw, option) ,
7129
7140
} ) ;
7130
7141
7131
7142
let ( channel_keys_id, holder_signer) = if let Some ( channel_keys_id) = channel_keys_id {
@@ -7229,6 +7240,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
7229
7240
next_counterparty_htlc_id,
7230
7241
update_time_counter,
7231
7242
feerate_per_kw,
7243
+ high_priority_feerate_per_kw,
7232
7244
7233
7245
#[ cfg( debug_assertions) ]
7234
7246
holder_max_commitment_tx_output : Mutex :: new ( ( 0 , 0 ) ) ,
0 commit comments