diff --git a/orderer/consensus/smartbft/chain.go b/orderer/consensus/smartbft/chain.go index 165fdd2976b..46c7fedc713 100644 --- a/orderer/consensus/smartbft/chain.go +++ b/orderer/consensus/smartbft/chain.go @@ -305,6 +305,13 @@ func (c *BFTChain) pruneCommittedRequests(block *cb.Block) { wg.Wait() } +func (c *BFTChain) pruneBadRequests() { + c.consensus.Pool.Prune(func(req []byte) error { + _, err := c.consensus.Verifier.VerifyRequest(req) + return err + }) +} + func (c *BFTChain) submit(env *cb.Envelope, configSeq uint64) error { reqBytes, err := proto.Marshal(env) if err != nil { @@ -556,6 +563,7 @@ func (c *BFTChain) updateRuntimeConfig(block *cb.Block) types.Reconfig { c.RuntimeConfig.Store(newRTC) if protoutil.IsConfigBlock(block) { c.Comm.Configure(c.Channel, newRTC.RemoteNodes) + c.pruneBadRequests() } membershipDidNotChange := reflect.DeepEqual(newRTC.Nodes, prevRTC.Nodes)