Browse Source

mempool: fix cache_size==0. closes #1761

pull/1764/head v0.20.1-rc0
Ethan Buchman 6 years ago
parent
commit
4b2348f697
2 changed files with 7 additions and 1 deletions
  1. +2
    -1
      CHANGELOG.md
  2. +5
    -0
      mempool/mempool.go

+ 2
- 1
CHANGELOG.md View File

@ -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


+ 5
- 0
mempool/mempool.go View File

@ -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…
Cancel
Save