From 6031c8a087acca799e9b16c093e5e045419e60e3 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 9 Jun 2020 17:26:21 +0300 Subject: [PATCH] consensus: fix processing changeview payloads from recovery message Using view number from the recovery message is just plain wrong, it's gonna be higher than our current view and these messages will be treated as coming from the future, even though they have their original view number included. --- pkg/consensus/recovery_message.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/consensus/recovery_message.go b/pkg/consensus/recovery_message.go index 030db04ab..f38a0e3c6 100644 --- a/pkg/consensus/recovery_message.go +++ b/pkg/consensus/recovery_message.go @@ -234,6 +234,7 @@ func (m *recoveryMessage) GetChangeViews(p payload.ConsensusPayload, validators newViewNumber: cv.OriginalViewNumber + 1, timestamp: cv.Timestamp, }) + c.message.ViewNumber = cv.OriginalViewNumber c.SetValidatorIndex(cv.ValidatorIndex) c.Witness.InvocationScript = cv.InvocationScript c.Witness.VerificationScript = getVerificationScript(cv.ValidatorIndex, validators)