aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-08-22 01:30:06 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-22 14:43:57 +0800
commite0d0e64ce22111a2d5492fe6f6d6a0023477e51f (patch)
tree553f970ffc21ac1a43d49948920da989a74d74d9 /cmd/utils/flags.go
parentb2c644ffb5c283a171ddf3889693673939917541 (diff)
downloadgo-tangerine-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.tar
go-tangerine-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.tar.gz
go-tangerine-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.tar.bz2
go-tangerine-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.tar.lz
go-tangerine-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.tar.xz
go-tangerine-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.tar.zst
go-tangerine-e0d0e64ce22111a2d5492fe6f6d6a0023477e51f.zip
cmd, core, miner: add --txpool.locals and priority mining
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go14
1 files changed, 14 insertions, 0 deletions
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)
}