From e65b5c9914db4fb41c7cb8c35219f4c58af34740 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 31 Jan 2020 15:02:03 +0300 Subject: [PATCH] consensus: fill preparation hash in recovery message --- pkg/consensus/consensus.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index 91dc47287..c6662ba10 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -177,6 +177,14 @@ func (s *service) eventLoop() { if msg.Type() == payload.RecoveryMessageType { rec := msg.GetRecoveryMessage().(*recoveryMessage) + if rec.preparationHash == nil { + req := rec.GetPrepareRequest(&msg, s.dbft.Validators, uint16(s.dbft.PrimaryIndex)) + if req != nil { + h := req.Hash() + rec.preparationHash = &h + } + } + fields = append(fields, zap.Int("#preparation", len(rec.preparationPayloads)), zap.Int("#commit", len(rec.commitPayloads)),