mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-04 07:07:13 +00:00
allow no recheck if empty block
This commit is contained in:
@@ -79,6 +79,7 @@ func GetConfig(rootDir string) cfg.Config {
|
||||
mapConfig.SetDefault("timeout_precommit_delta", 500)
|
||||
mapConfig.SetDefault("timeout_commit", 1000)
|
||||
mapConfig.SetDefault("mempool_recheck", true)
|
||||
mapConfig.SetDefault("mempool_recheck_empty", true)
|
||||
mapConfig.SetDefault("mempool_broadcast", true)
|
||||
|
||||
return mapConfig
|
||||
|
||||
@@ -97,6 +97,7 @@ func GetConfig(rootDir string) cfg.Config {
|
||||
mapConfig.SetDefault("timeout_precommit_delta", 1)
|
||||
mapConfig.SetDefault("timeout_commit", 1)
|
||||
mapConfig.SetDefault("mempool_recheck", true)
|
||||
mapConfig.SetDefault("mempool_recheck_empty", true)
|
||||
mapConfig.SetDefault("mempool_broadcast", true)
|
||||
|
||||
return mapConfig
|
||||
|
||||
+5
-2
@@ -245,8 +245,11 @@ func (mem *Mempool) Update(height int, txs []types.Tx) {
|
||||
mem.height = height
|
||||
// Remove transactions that are already in txs.
|
||||
goodTxs := mem.filterTxs(txsMap)
|
||||
// Recheck mempool txs
|
||||
if config.GetBool("mempool_recheck") {
|
||||
// Recheck mempool txs if any txs were committed in the block
|
||||
// NOTE/XXX: in some apps a tx could be invalidated due to EndBlock,
|
||||
// so we really still do need to recheck, but this is for debugging
|
||||
if config.GetBool("mempool_recheck") &&
|
||||
(config.GetBool("mempool_recheck_empty") || len(txs) > 0) {
|
||||
log.Info("Recheck txs", "numtxs", len(goodTxs))
|
||||
mem.recheckTxs(goodTxs)
|
||||
// At this point, mem.txs are being rechecked.
|
||||
|
||||
Reference in New Issue
Block a user