From 7016280d1c0c83f69893ff40946158a17b77059f Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Wed, 9 Oct 2019 15:04:53 -0700 Subject: [PATCH] Warn if server is behind --- src/lightclient.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lightclient.rs b/src/lightclient.rs index ea5fa71..d9d7295 100644 --- a/src/lightclient.rs +++ b/src/lightclient.rs @@ -569,6 +569,12 @@ impl LightClient { }); let latest_block = latest_block_height.load(Ordering::SeqCst); + if latest_block < last_scanned_height { + let w = format!("Server's latest block({}) is behind ours({})", latest_block, last_scanned_height); + warn!("{}", w); + return w; + } + info!("Latest block is {}", latest_block); // Get the end height to scan to.