From 0ef327bbee79c01a69ba59258acc6ce3a48bc288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 1 Jul 2016 18:59:55 +0300 Subject: core, eth, internal, miner: optimize txpool for quick ops --- miner/worker.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'miner') diff --git a/miner/worker.go b/miner/worker.go index f243fe799..b46b368ea 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -501,8 +501,7 @@ func (self *worker) commitNewWork() { */ //approach 2 - transactions := self.eth.TxPool().GetTransactions() - types.SortByPriceAndNonce(transactions) + transactions := types.SortByPriceAndNonce(self.eth.TxPool().Pending()) /* // approach 3 // commit transactions for this run. @@ -533,8 +532,8 @@ func (self *worker) commitNewWork() { work.commitTransactions(self.mux, transactions, self.gasPrice, self.chain) - self.eth.TxPool().RemoveTransactions(work.lowGasTxs) - self.eth.TxPool().RemoveTransactions(work.failedTxs) + self.eth.TxPool().RemoveBatch(work.lowGasTxs) + self.eth.TxPool().RemoveBatch(work.failedTxs) // compute uncles for the new block. var ( -- cgit v1.2.3