diff --git a/core/txpool/list.go b/core/txpool/list.go index ef1948e261..82c87b4263 100644 --- a/core/txpool/list.go +++ b/core/txpool/list.go @@ -46,6 +46,7 @@ func (h *nonceHeap) Pop() interface{} { old := *h n := len(old) x := old[n-1] + old[n-1] = 0 // avoid memory leak *h = old[0 : n-1] return x } diff --git a/core/types/transaction.go b/core/types/transaction.go index 15f692458b..1e1cdeca6e 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -704,6 +704,7 @@ func (s *TxByPriceAndTime) Pop() interface{} { old := s.txs n := len(old) x := old[n-1] + old[n-1] = nil // avoid memory leak s.txs = old[0 : n-1] return x }