From 26f303f3ed39fbb89bb1c87159a2b08f47fa4ea5 Mon Sep 17 00:00:00 2001 From: Nick Johnson Date: Tue, 9 Jan 2018 13:15:50 +0000 Subject: [PATCH] eth/gasprice: Make a copy of transaction pointers before sorting --- eth/gasprice/gasprice.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 2b7870e05b..54325692c6 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -167,7 +167,9 @@ func (gpo *Oracle) getBlockPrices(ctx context.Context, signer types.Signer, bloc return } - txs := block.Transactions() + blockTxs := block.Transactions() + txs := make([]*types.Transaction, len(blockTxs)) + copy(txs, blockTxs) sort.Sort(transactionsByGasPrice(txs)) for _, tx := range txs {