diff --git a/config/tendermint/config.go b/config/tendermint/config.go index 74bf7b2ff..6378607fe 100644 --- a/config/tendermint/config.go +++ b/config/tendermint/config.go @@ -79,7 +79,6 @@ func GetConfig(rootDir string) cfg.Config { mapConfig.SetDefault("timeout_commit", 1000) mapConfig.SetDefault("mempool_recheck", true) mapConfig.SetDefault("mempool_broadcast", true) - mapConfig.SetDefault("mempool_reap", true) return mapConfig } diff --git a/config/tendermint_test/config.go b/config/tendermint_test/config.go index 1263dc135..bb886a2b7 100644 --- a/config/tendermint_test/config.go +++ b/config/tendermint_test/config.go @@ -103,7 +103,6 @@ func GetConfig(rootDir string) cfg.Config { mapConfig.SetDefault("timeout_commit", 1) mapConfig.SetDefault("mempool_recheck", true) mapConfig.SetDefault("mempool_broadcast", true) - mapConfig.SetDefault("mempool_reap", true) return mapConfig } diff --git a/consensus/state.go b/consensus/state.go index 22bc8c52a..386b53a00 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -877,11 +877,16 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts return } + maxBlockSize := config.GetInt("block_size") + // Mempool validated transactions - txs := cs.mempool.Reap() + // if block_size < 0, no txs will be included + var txs []types.Tx + if maxBlockSize >= 0 { + txs = cs.mempool.Reap() + } // Cap the number of txs in a block - maxBlockSize := config.GetInt("block_size") if maxBlockSize > 0 && maxBlockSize < len(txs) { txs = txs[:maxBlockSize] } diff --git a/mempool/mempool.go b/mempool/mempool.go index a511c2e46..1d0a375d6 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -184,10 +184,6 @@ func (mem *Mempool) resCbRecheck(req *tmsp.Request, res *tmsp.Response) { // Get the valid transactions remaining func (mem *Mempool) Reap() []types.Tx { - if !config.GetBool("mempool_reap") { - return []types.Tx{} - } - mem.proxyMtx.Lock() defer mem.proxyMtx.Unlock()