aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-01-28 23:11:14 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-01-28 23:11:14 +0800
commitae1a137ce7daa885938e010dccd8436f8570329f (patch)
tree8a0d72ce7e06331abbf081889ee2b3e6ff770a11 /miner
parent63e76482ac0021afc80b504046c058b8d96891b2 (diff)
parenta2dc074b1ddffaf4e35758835bafe14cca5f0ea7 (diff)
downloadgo-tangerine-ae1a137ce7daa885938e010dccd8436f8570329f.tar
go-tangerine-ae1a137ce7daa885938e010dccd8436f8570329f.tar.gz
go-tangerine-ae1a137ce7daa885938e010dccd8436f8570329f.tar.bz2
go-tangerine-ae1a137ce7daa885938e010dccd8436f8570329f.tar.lz
go-tangerine-ae1a137ce7daa885938e010dccd8436f8570329f.tar.xz
go-tangerine-ae1a137ce7daa885938e010dccd8436f8570329f.tar.zst
go-tangerine-ae1a137ce7daa885938e010dccd8436f8570329f.zip
Merge pull request #2143 from karalabe/fix-transaction-sort-2
core, core/types, miner: fix transaction nonce-price combo sort
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 1a411ae20..9c29d2250 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -19,7 +19,6 @@ package miner
import (
"fmt"
"math/big"
- "sort"
"sync"
"sync/atomic"
"time"
@@ -496,12 +495,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.
@@ -525,8 +524,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...)
*/