From 48bcc60a9cd637e6ab2ab537ea10a0fc37fcc963 Mon Sep 17 00:00:00 2001 From: NathanBSC Date: Mon, 7 Aug 2023 10:37:30 +0800 Subject: [PATCH] vote: disable votepool when bsc protocol not enabled --- consensus/parlia/parlia.go | 2 +- eth/backend.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 3ea1591c1c..7269b490ee 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -827,7 +827,7 @@ func (p *Parlia) assembleVoteAttestation(chain consensus.ChainHeaderReader, head } if p.VotePool == nil { - return errors.New("vote pool is nil") + return nil } // Fetch direct parent's votes diff --git a/eth/backend.go b/eth/backend.go index e4b0e0ae98..4ba9e0a8c0 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -279,7 +279,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData)) // Create voteManager instance - if posa, ok := eth.engine.(consensus.PoSA); ok { + if posa, ok := eth.engine.(consensus.PoSA); ok && !config.DisableBscProtocol { // Create votePool instance votePool := vote.NewVotePool(chainConfig, eth.blockchain, posa) eth.votePool = votePool