diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-08-22 01:30:06 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-08-22 14:43:57 +0800 |
commit | e0d0e64ce22111a2d5492fe6f6d6a0023477e51f (patch) | |
tree | 553f970ffc21ac1a43d49948920da989a74d74d9 /cmd | |
parent | b2c644ffb5c283a171ddf3889693673939917541 (diff) | |
download | dexon-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.tar.gz dexon-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.tar.zst dexon-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.zip |
cmd, core, miner: add --txpool.locals and priority mining
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/main.go | 1 | ||||
-rw-r--r-- | cmd/geth/usage.go | 1 | ||||
-rw-r--r-- | cmd/utils/flags.go | 14 |
3 files changed, 16 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 2e87bb820..4b86382bd 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -72,6 +72,7 @@ var ( utils.EthashDatasetDirFlag, utils.EthashDatasetsInMemoryFlag, utils.EthashDatasetsOnDiskFlag, + utils.TxPoolLocalsFlag, utils.TxPoolNoLocalsFlag, utils.TxPoolJournalFlag, utils.TxPoolRejournalFlag, diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 674c5d901..1e27d0ae8 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -114,6 +114,7 @@ var AppHelpFlagGroups = []flagGroup{ { Name: "TRANSACTION POOL", Flags: []cli.Flag{ + utils.TxPoolLocalsFlag, utils.TxPoolNoLocalsFlag, utils.TxPoolJournalFlag, utils.TxPoolRejournalFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 731765583..cfca7b4ab 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -233,6 +233,10 @@ var ( Value: eth.DefaultConfig.Ethash.DatasetsOnDisk, } // Transaction pool settings + TxPoolLocalsFlag = cli.StringFlag{ + Name: "txpool.locals", + Usage: "Comma separated accounts to treat as locals (no flush, priority inclusion)", + } TxPoolNoLocalsFlag = cli.BoolFlag{ Name: "txpool.nolocals", Usage: "Disables price exemptions for locally submitted transactions", @@ -977,6 +981,16 @@ func setGPO(ctx *cli.Context, cfg *gasprice.Config) { } func setTxPool(ctx *cli.Context, cfg *core.TxPoolConfig) { + if ctx.GlobalIsSet(TxPoolLocalsFlag.Name) { + locals := strings.Split(ctx.GlobalString(TxPoolLocalsFlag.Name), ",") + for _, account := range locals { + if trimmed := strings.TrimSpace(account); !common.IsHexAddress(trimmed) { + Fatalf("Invalid account in --txpool.locals: %s", trimmed) + } else { + cfg.Locals = append(cfg.Locals, common.HexToAddress(account)) + } + } + } if ctx.GlobalIsSet(TxPoolNoLocalsFlag.Name) { cfg.NoLocals = ctx.GlobalBool(TxPoolNoLocalsFlag.Name) } |