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 {
261261 log_info ! ( self . logger, "Starting continuous polling for chain updates." ) ;
262262
263263 // Start the polling loop.
264+ let mut last_best_block_hash = None ;
264265 loop {
265266 tokio:: select! {
266267 _ = stop_sync_receiver. changed( ) => {
@@ -278,7 +279,12 @@ impl BitcoindChainSource {
278279 ) . await ;
279280 }
280281 _ = 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+ }
282288 }
283289 }
284290 }
You can’t perform that action at this time.
0 commit comments