mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 05:46:32 +00:00
mempool: add txs from Update to cache
We should add txs that come in from mempool.Update to the mempool's cache, so that they never hit a potentially expensive check tx. Originally posted by @ValarDragon in #2846 https://github.com/tendermint/tendermint/issues/2846#issuecomment-439216656 Refs #2855
This commit is contained in:
@@ -545,6 +545,11 @@ func (mem *Mempool) Update(
|
||||
mem.postCheck = postCheck
|
||||
}
|
||||
|
||||
// Add committed transactions to cache (if missing).
|
||||
for _, tx := range txs {
|
||||
_ = mem.cache.Push(tx)
|
||||
}
|
||||
|
||||
// Remove committed transactions.
|
||||
txsLeft := mem.removeTxs(txs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user