[release/1.4.17] core, eth, internal, miner: optimize txpool for quick ops

(cherry picked from commit 0ef327bbee)
This commit is contained in:
Péter Szilágyi
2016-07-01 18:59:55 +03:00
committed by Felix Lange
parent df64a9f5ef
commit ff697e82dc
13 changed files with 812 additions and 452 deletions

View File

@@ -45,7 +45,10 @@ type txsync struct {
// syncTransactions starts sending all currently pending transactions to the given peer.
func (pm *ProtocolManager) syncTransactions(p *peer) {
txs := pm.txpool.GetTransactions()
var txs types.Transactions
for _, batch := range pm.txpool.Pending() {
txs = append(txs, batch...)
}
if len(txs) == 0 {
return
}