aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go1
-rw-r--r--cmd/geth/usage.go1
-rw-r--r--cmd/utils/flags.go14
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)
}