@@ -126,25 +126,38 @@ where
126
126
] ;
127
127
for target in confirmation_targets {
128
128
let num_blocks = match target {
129
- ConfirmationTarget :: OnChainSweep => 3 ,
129
+ ConfirmationTarget :: OnChainSweep => 6 ,
130
130
ConfirmationTarget :: MaxAllowedNonAnchorChannelRemoteFee => 1 ,
131
131
ConfirmationTarget :: MinAllowedAnchorChannelRemoteFee => 1008 ,
132
- ConfirmationTarget :: MinAllowedNonAnchorChannelRemoteFee => 12 ,
133
- ConfirmationTarget :: AnchorChannelFee => 12 ,
134
- ConfirmationTarget :: NonAnchorChannelFee => 6 ,
135
- ConfirmationTarget :: ChannelCloseMinimum => 12 ,
132
+ ConfirmationTarget :: MinAllowedNonAnchorChannelRemoteFee => 144 ,
133
+ ConfirmationTarget :: AnchorChannelFee => 1008 ,
134
+ ConfirmationTarget :: NonAnchorChannelFee => 12 ,
135
+ ConfirmationTarget :: ChannelCloseMinimum => 144 ,
136
136
} ;
137
137
138
138
let est_fee_rate = self . blockchain . estimate_fee ( num_blocks) . await ;
139
139
140
140
match est_fee_rate {
141
141
Ok ( rate) => {
142
- locked_fee_rate_cache. insert ( target, rate) ;
142
+ // LDK 0.0.118 introduced changes to the `ConfirmationTarget` semantics that
143
+ // require some post-estimation adjustments to the fee rates, which we do here.
144
+ let adjusted_fee_rate = match target {
145
+ ConfirmationTarget :: MaxAllowedNonAnchorChannelRemoteFee => {
146
+ let really_high_prio = rate. as_sat_per_vb ( ) * 10.0 ;
147
+ FeeRate :: from_sat_per_vb ( really_high_prio)
148
+ }
149
+ ConfirmationTarget :: MinAllowedNonAnchorChannelRemoteFee => {
150
+ let slightly_less_than_background = rate. fee_wu ( 1000 ) - 250 ;
151
+ FeeRate :: from_sat_per_kwu ( slightly_less_than_background as f32 )
152
+ }
153
+ _ => rate,
154
+ } ;
155
+ locked_fee_rate_cache. insert ( target, adjusted_fee_rate) ;
143
156
log_trace ! (
144
157
self . logger,
145
158
"Fee rate estimation updated for {:?}: {} sats/kwu" ,
146
159
target,
147
- rate . fee_wu( 1000 )
160
+ adjusted_fee_rate . fee_wu( 1000 )
148
161
) ;
149
162
}
150
163
Err ( e) => {
0 commit comments