aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-07-01 23:59:55 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-09-02 19:12:03 +0800
commit0ef327bbee79c01a69ba59258acc6ce3a48bc288 (patch)
tree1d43179977d96c5ca7de85e0727cfa69dbb230ed /miner
parent795b70423eac7180ab85b735f64aae9d6a10449d (diff)
downloaddexon-0ef327bbee79c01a69ba59258acc6ce3a48bc288.tar
dexon-0ef327bbee79c01a69ba59258acc6ce3a48bc288.tar.gz
dexon-0ef327bbee79c01a69ba59258acc6ce3a48bc288.tar.bz2
dexon-0ef327bbee79c01a69ba59258acc6ce3a48bc288.tar.lz
dexon-0ef327bbee79c01a69ba59258acc6ce3a48bc288.tar.xz
dexon-0ef327bbee79c01a69ba59258acc6ce3a48bc288.tar.zst
dexon-0ef327bbee79c01a69ba59258acc6ce3a48bc288.zip
core, eth, internal, miner: optimize txpool for quick ops
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go7
1 files changed, 3 insertions, 4 deletions
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 (