eth/gasprice: Make a copy of transaction pointers before sorting

This commit is contained in:
Nick Johnson 2018-01-09 13:15:50 +00:00
parent cd85458aa2
commit 26f303f3ed

View file

@ -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 {