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