From 30797717dfa7d627d4be06467bf6d2da89b95f80 Mon Sep 17 00:00:00 2001 From: HaoyangLiu Date: Wed, 6 Mar 2019 14:28:52 +0800 Subject: [PATCH] Add latest tx to the back of cache list, in case of being removed by other tx insertion --- mempool/mempool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mempool/mempool.go b/mempool/mempool.go index c5f966c4ef0..3a1921bc21d 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -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 }