cmd, core, miner: add --txpool.locals and priority mining
This commit is contained in:
@ -877,11 +877,26 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool) {
|
||||
w.updateSnapshot()
|
||||
return
|
||||
}
|
||||
txs := types.NewTransactionsByPriceAndNonce(w.current.signer, pending)
|
||||
if w.commitTransactions(txs, w.coinbase, interrupt) {
|
||||
return
|
||||
// Split the pending transactions into locals and remotes
|
||||
localTxs, remoteTxs := make(map[common.Address]types.Transactions), pending
|
||||
for _, account := range w.eth.TxPool().Locals() {
|
||||
if txs := remoteTxs[account]; len(txs) > 0 {
|
||||
delete(remoteTxs, account)
|
||||
localTxs[account] = txs
|
||||
}
|
||||
}
|
||||
if len(localTxs) > 0 {
|
||||
txs := types.NewTransactionsByPriceAndNonce(w.current.signer, localTxs)
|
||||
if w.commitTransactions(txs, w.coinbase, interrupt) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if len(remoteTxs) > 0 {
|
||||
txs := types.NewTransactionsByPriceAndNonce(w.current.signer, remoteTxs)
|
||||
if w.commitTransactions(txs, w.coinbase, interrupt) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
w.commit(uncles, w.fullTaskHook, true, tstart)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user