diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index a53e0257d..4a848e10b 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -138,7 +138,7 @@ func NewService(cfg Config) (Service, error) { dbft.WithGetValidators(srv.getValidators), dbft.WithGetConsensusAddress(srv.getConsensusAddress), - dbft.WithNewConsensusPayload(func() payload.ConsensusPayload { p := new(Payload); p.message = &message{}; return p }), + dbft.WithNewConsensusPayload(srv.newPayload), dbft.WithNewPrepareRequest(srv.newPrepareRequest), dbft.WithNewPrepareResponse(func() payload.PrepareResponse { return new(prepareResponse) }), dbft.WithNewChangeView(func() payload.ChangeView { return new(changeView) }), @@ -214,6 +214,12 @@ func (s *service) eventLoop() { } } +func (s *service) newPayload() payload.ConsensusPayload { + return &Payload{ + message: new(message), + } +} + func (s *service) newPrepareRequest() payload.PrepareRequest { sr, err := s.Chain.GetStateRoot(s.Chain.BlockHeight()) if err != nil {