Skip to content

Commit

Permalink
Add latest tx to the back of cache list, in case of being removed by …
Browse files Browse the repository at this point in the history
…other tx insertion
  • Loading branch information
HaoyangLiu committed Mar 6, 2019
1 parent 7715be4 commit 3079771
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 3079771

Please # to comment.