From 4f462cdfdca2c15aa6309a3885388a3fe21c428e Mon Sep 17 00:00:00 2001 From: Gary Yu Date: Thu, 11 Oct 2018 12:38:13 +0800 Subject: [PATCH] fix: avoid a confusing log when fastsync start (#1720) --- servers/src/grin/sync/state_sync.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/servers/src/grin/sync/state_sync.rs b/servers/src/grin/sync/state_sync.rs index c834f0e2..a9b598a3 100644 --- a/servers/src/grin/sync/state_sync.rs +++ b/servers/src/grin/sync/state_sync.rs @@ -123,6 +123,19 @@ impl StateSync { } Err(e) => self.sync_state.set_sync_error(Error::P2P(e)), } + + // to avoid the confusing log, + // update the final HeaderSync state mainly for 'current_height' + { + let status = self.sync_state.status(); + if let SyncStatus::HeaderSync { .. } = status { + self.sync_state.update(SyncStatus::HeaderSync { + current_height: header_head.height, + highest_height, + }); + } + } + self.sync_state.update(SyncStatus::TxHashsetDownload); } }