mempool: fix cache_size==0. closes #1761
This commit is contained in:
parent
6a324764ac
commit
4b2348f697
|
@ -6,7 +6,8 @@
|
|||
|
||||
BUG FIXES
|
||||
|
||||
[consensus] Fix #1754 where we don't make blocks when `create_empty_blocks=false`
|
||||
- [consensus] Fix #1754 where we don't make blocks when `create_empty_blocks=false`
|
||||
- [mempool] Fix #1761 where we don't process txs if `cache_size=0`
|
||||
|
||||
## 0.20.0
|
||||
|
||||
|
|
|
@ -478,6 +478,11 @@ func (cache *txCache) Push(tx types.Tx) bool {
|
|||
cache.mtx.Lock()
|
||||
defer cache.mtx.Unlock()
|
||||
|
||||
// if cache size is 0, do nothing
|
||||
if cache.size == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
if _, exists := cache.map_[string(tx)]; exists {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue