|
|
|
@ -23,6 +23,7 @@ import ( |
|
|
|
|
"math/big" |
|
|
|
|
"runtime" |
|
|
|
|
"sync" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/accounts" |
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
@ -35,7 +36,7 @@ import ( |
|
|
|
|
"github.com/ethereum/go-ethereum/core/txpool" |
|
|
|
|
"github.com/ethereum/go-ethereum/core/txpool/blobpool" |
|
|
|
|
"github.com/ethereum/go-ethereum/core/txpool/legacypool" |
|
|
|
|
"github.com/ethereum/go-ethereum/core/txpool/tracking" |
|
|
|
|
"github.com/ethereum/go-ethereum/core/txpool/tracker" |
|
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
|
"github.com/ethereum/go-ethereum/core/vm" |
|
|
|
|
"github.com/ethereum/go-ethereum/eth/downloader" |
|
|
|
@ -70,7 +71,7 @@ type Ethereum struct { |
|
|
|
|
// core protocol objects
|
|
|
|
|
config *ethconfig.Config |
|
|
|
|
txPool *txpool.TxPool |
|
|
|
|
localTxTracker *tracking.TxTracker |
|
|
|
|
localTxTracker *tracker.TxTracker |
|
|
|
|
blockchain *core.BlockChain |
|
|
|
|
|
|
|
|
|
handler *handler |
|
|
|
@ -238,12 +239,12 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { |
|
|
|
|
eth.txPool, err = txpool.New(config.TxPool.PriceLimit, eth.blockchain, []txpool.SubPool{legacyPool, blobPool}) |
|
|
|
|
|
|
|
|
|
if !config.TxPool.NoLocals { |
|
|
|
|
// TODO!
|
|
|
|
|
// We also need to handle config.Locals, the accounts that are
|
|
|
|
|
// to be treated as locals, regardless of how they arrive to geth.
|
|
|
|
|
eth.localTxTracker = tracking.NewTxTracker(config.TxPool.Journal, |
|
|
|
|
config.TxPool.Rejournal, |
|
|
|
|
eth.blockchain.Config(), eth.txPool) |
|
|
|
|
rejournal := config.TxPool.Rejournal |
|
|
|
|
if rejournal < time.Second { |
|
|
|
|
log.Warn("Sanitizing invalid txpool journal time", "provided", rejournal, "updated", time.Second) |
|
|
|
|
rejournal = time.Second |
|
|
|
|
} |
|
|
|
|
eth.localTxTracker = tracker.New(config.TxPool.Journal, rejournal, eth.blockchain.Config(), eth.txPool) |
|
|
|
|
stack.RegisterLifecycle(eth.localTxTracker) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -340,8 +341,7 @@ func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) { |
|
|
|
|
s.blockchain.ResetWithGenesisBlock(gb) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (s *Ethereum) Miner() *miner.Miner { return s.miner } |
|
|
|
|
func (s *Ethereum) Tracker() *tracking.TxTracker { return s.localTxTracker } |
|
|
|
|
func (s *Ethereum) Miner() *miner.Miner { return s.miner } |
|
|
|
|
|
|
|
|
|
func (s *Ethereum) AccountManager() *accounts.Manager { return s.accountManager } |
|
|
|
|
func (s *Ethereum) BlockChain() *core.BlockChain { return s.blockchain } |
|
|
|
|