Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/chain/bitcoind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ impl BitcoindChainSource {
log_info!(self.logger, "Starting continuous polling for chain updates.");

// Start the polling loop.
let mut last_best_block_hash = None;
loop {
tokio::select! {
_ = stop_sync_receiver.changed() => {
Expand All @@ -278,7 +279,12 @@ impl BitcoindChainSource {
).await;
}
_ = fee_rate_update_interval.tick() => {
let _ = self.update_fee_rate_estimates().await;
if last_best_block_hash != Some(channel_manager.current_best_block().block_hash) {
let update_res = self.update_fee_rate_estimates().await;
if update_res.is_ok() {
last_best_block_hash = Some(channel_manager.current_best_block().block_hash);
}
}
}
}
}
Expand Down
Loading