File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,7 @@ impl BitcoindChainSource {
261
261
log_info ! ( self . logger, "Starting continuous polling for chain updates." ) ;
262
262
263
263
// Start the polling loop.
264
+ let mut last_best_block_hash = None ;
264
265
loop {
265
266
tokio:: select! {
266
267
_ = stop_sync_receiver. changed( ) => {
@@ -278,7 +279,12 @@ impl BitcoindChainSource {
278
279
) . await ;
279
280
}
280
281
_ = fee_rate_update_interval. tick( ) => {
281
- let _ = self . update_fee_rate_estimates( ) . await ;
282
+ if last_best_block_hash != Some ( channel_manager. current_best_block( ) . block_hash) {
283
+ let update_res = self . update_fee_rate_estimates( ) . await ;
284
+ if update_res. is_ok( ) {
285
+ last_best_block_hash = Some ( channel_manager. current_best_block( ) . block_hash) ;
286
+ }
287
+ }
282
288
}
283
289
}
284
290
}
You can’t perform that action at this time.
0 commit comments