From 3c801dc8e4284e342f4479f30ba010e09b1b2760 Mon Sep 17 00:00:00 2001 From: erikzhang Date: Sat, 16 Feb 2019 15:11:43 +0800 Subject: [PATCH] Should not set `ResponseSent` flag if we are the primary --- neo/Consensus/ConsensusService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/neo/Consensus/ConsensusService.cs b/neo/Consensus/ConsensusService.cs index 6611be4d3d..cd43aeaf95 100644 --- a/neo/Consensus/ConsensusService.cs +++ b/neo/Consensus/ConsensusService.cs @@ -70,13 +70,12 @@ private bool AddTransaction(Transaction tx, bool verify) { if (context.VerifyRequest()) { - context.State |= ConsensusState.ResponseSent; - // if we are the primary for this view, but acting as a backup because we recovered our own // previously sent prepare request, then we don't want to send a prepare response. if (context.MyIndex == context.PrimaryIndex) return true; Log($"send prepare response"); + context.State |= ConsensusState.ResponseSent; var payload = context.MakePrepareResponse(context.PreparationPayloads[context.PrimaryIndex].Hash); context.PreparationPayloads[context.MyIndex] = payload; localNode.Tell(new LocalNode.SendDirectly { Inventory = payload });