aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-05-29 16:42:48 +0800
committerGitHub <noreply@github.com>2017-05-29 16:42:48 +0800
commitdd06c8584368316c8fb388384b0723d8c7e543f0 (patch)
tree6b0daa3ff79df3bf6405237dbee4cbceacb0c4d0 /eth
parentae40d51410f6fa958d08cd34f9e8586edb88fdf1 (diff)
parent08959bbc70ade02109c819fdee72be1ed9310726 (diff)
downloaddexon-dd06c8584368316c8fb388384b0723d8c7e543f0.tar
dexon-dd06c8584368316c8fb388384b0723d8c7e543f0.tar.gz
dexon-dd06c8584368316c8fb388384b0723d8c7e543f0.tar.bz2
dexon-dd06c8584368316c8fb388384b0723d8c7e543f0.tar.lz
dexon-dd06c8584368316c8fb388384b0723d8c7e543f0.tar.xz
dexon-dd06c8584368316c8fb388384b0723d8c7e543f0.tar.zst
dexon-dd06c8584368316c8fb388384b0723d8c7e543f0.zip
Merge pull request #14523 from karalabe/txpool-cli-flags
cmd, core, eth: configurable txpool parameters
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go2
-rw-r--r--eth/config.go4
-rw-r--r--eth/gen_config.go6
3 files changed, 11 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go
index dc813ed0d..639792333 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -150,7 +150,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
core.WriteChainConfig(chainDb, genesisHash, chainConfig)
}
- newPool := core.NewTxPool(eth.chainConfig, eth.EventMux(), eth.blockchain.State, eth.blockchain.GasLimit)
+ newPool := core.NewTxPool(config.TxPool, eth.chainConfig, eth.EventMux(), eth.blockchain.State, eth.blockchain.GasLimit)
eth.txPool = newPool
maxPeers := config.MaxPeers
diff --git a/eth/config.go b/eth/config.go
index 22c09b170..4109cff8b 100644
--- a/eth/config.go
+++ b/eth/config.go
@@ -44,6 +44,7 @@ var DefaultConfig = Config{
DatabaseCache: 128,
GasPrice: big.NewInt(18 * params.Shannon),
+ TxPool: core.DefaultTxPoolConfig,
GPO: gasprice.Config{
Blocks: 10,
Percentile: 50,
@@ -99,6 +100,9 @@ type Config struct {
EthashDatasetsInMem int
EthashDatasetsOnDisk int
+ // Transaction pool options
+ TxPool core.TxPoolConfig
+
// Gas Price Oracle options
GPO gasprice.Config
diff --git a/eth/gen_config.go b/eth/gen_config.go
index 955facf8f..477479419 100644
--- a/eth/gen_config.go
+++ b/eth/gen_config.go
@@ -33,6 +33,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
EthashDatasetDir string
EthashDatasetsInMem int
EthashDatasetsOnDisk int
+ TxPool core.TxPoolConfig
GPO gasprice.Config
EnablePreimageRecording bool
DocRoot string `toml:"-"`
@@ -60,6 +61,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.EthashDatasetDir = c.EthashDatasetDir
enc.EthashDatasetsInMem = c.EthashDatasetsInMem
enc.EthashDatasetsOnDisk = c.EthashDatasetsOnDisk
+ enc.TxPool = c.TxPool
enc.GPO = c.GPO
enc.EnablePreimageRecording = c.EnablePreimageRecording
enc.DocRoot = c.DocRoot
@@ -90,6 +92,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
EthashDatasetDir *string
EthashDatasetsInMem *int
EthashDatasetsOnDisk *int
+ TxPool *core.TxPoolConfig
GPO *gasprice.Config
EnablePreimageRecording *bool
DocRoot *string `toml:"-"`
@@ -158,6 +161,9 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.EthashDatasetsOnDisk != nil {
c.EthashDatasetsOnDisk = *dec.EthashDatasetsOnDisk
}
+ if dec.TxPool != nil {
+ c.TxPool = *dec.TxPool
+ }
if dec.GPO != nil {
c.GPO = *dec.GPO
}