Skip to content

Commit

Permalink
Merge pull request #47 from HaoyangLiu/fix-LRU-cache-issue
Browse files Browse the repository at this point in the history
R4R: Add latest tx to the back of cache list
  • Loading branch information
wukongcheng authored Mar 6, 2019
2 parents 7715be4 + 3079771 commit add95d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ func (cache *mapTxCache) Push(tx types.Tx) bool {
// Use the tx hash in the cache
txHash := sha256.Sum256(tx)
if moved, exists := cache.map_[txHash]; exists {
cache.list.MoveToFront(moved)
cache.list.MoveToBack(moved)
return false
}

Expand Down

0 comments on commit add95d4

Please sign in to comment.