diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-01-22 18:05:17 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-02-24 20:46:06 +0800 |
commit | 300f1e2abfeaaa2efed96d522e99ffd11729fc08 (patch) | |
tree | 693f046095289d2d2f872a3318dc7ed7bb39794a /miner | |
parent | 4ce7970340da03a6c185f6e83ebfbb4d1e0d6e49 (diff) | |
download | go-tangerine-300f1e2abfeaaa2efed96d522e99ffd11729fc08.tar go-tangerine-300f1e2abfeaaa2efed96d522e99ffd11729fc08.tar.gz go-tangerine-300f1e2abfeaaa2efed96d522e99ffd11729fc08.tar.bz2 go-tangerine-300f1e2abfeaaa2efed96d522e99ffd11729fc08.tar.lz go-tangerine-300f1e2abfeaaa2efed96d522e99ffd11729fc08.tar.xz go-tangerine-300f1e2abfeaaa2efed96d522e99ffd11729fc08.tar.zst go-tangerine-300f1e2abfeaaa2efed96d522e99ffd11729fc08.zip |
[release/1.3.4] core, core/types, miner: fix transaction nonce-price combo sort
Diffstat (limited to 'miner')
-rw-r--r-- | miner/worker.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/miner/worker.go b/miner/worker.go index 754a6fc48..7f24da8ac 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -19,7 +19,6 @@ package miner import ( "fmt" "math/big" - "sort" "sync" "sync/atomic" "time" @@ -495,12 +494,12 @@ func (self *worker) commitNewWork() { /* //approach 1 transactions := self.eth.TxPool().GetTransactions() - sort.Sort(types.TxByNonce{transactions}) + sort.Sort(types.TxByNonce(transactions)) */ //approach 2 transactions := self.eth.TxPool().GetTransactions() - sort.Sort(types.TxByPriceAndNonce{transactions}) + types.SortByPriceAndNonce(transactions) /* // approach 3 // commit transactions for this run. @@ -524,8 +523,8 @@ func (self *worker) commitNewWork() { multiTxOwner = append(multiTxOwner, txs...) } } - sort.Sort(types.TxByPrice{singleTxOwner}) - sort.Sort(types.TxByNonce{multiTxOwner}) + sort.Sort(types.TxByPrice(singleTxOwner)) + sort.Sort(types.TxByNonce(multiTxOwner)) transactions := append(singleTxOwner, multiTxOwner...) */ |