From 9fa04a45b930dd60f655e98fd77ea124eec18741 Mon Sep 17 00:00:00 2001 From: Shargon Date: Wed, 13 May 2020 17:47:52 +0200 Subject: [PATCH] Improve gap calculation --- src/neo/Consensus/ConsensusService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neo/Consensus/ConsensusService.cs b/src/neo/Consensus/ConsensusService.cs index e39eab19b2..6995310af4 100644 --- a/src/neo/Consensus/ConsensusService.cs +++ b/src/neo/Consensus/ConsensusService.cs @@ -319,11 +319,11 @@ private void OnConsensusPayload(ConsensusPayload payload) private void OnPersistCompleted(Block block) { Log($"persist block: height={block.Index} hash={block.Hash} tx={block.Transactions.Length}"); + knownHashes.Clear(); + InitializeConsensus(0); DateTime now = TimeProvider.Current.UtcNow; block_received_gap = now - block_received_time; block_received_time = now; - knownHashes.Clear(); - InitializeConsensus(0); } private void OnRecoveryMessageReceived(ConsensusPayload payload, RecoveryMessage message)