aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorBas van Kervel <basvankervel@gmail.com>2017-06-21 16:49:14 +0800
committerBas van Kervel <basvankervel@gmail.com>2017-06-21 16:49:14 +0800
commit7a11e86442ab51401ad764777666133d82656264 (patch)
tree29154393cabb1e0f55e267b6bbf17bc6e28c37b4 /cmd/utils/flags.go
parent4a1d516d78f61937d850c6622bc26955b5103a23 (diff)
downloadgo-tangerine-7a11e86442ab51401ad764777666133d82656264.tar.gz
go-tangerine-7a11e86442ab51401ad764777666133d82656264.tar.zst
go-tangerine-7a11e86442ab51401ad764777666133d82656264.zip
whisper: move flags from whisper package to utils
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go22
1 files changed, 18 insertions, 4 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 095a9f62c..b5a593ab6 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -458,6 +458,20 @@ var (
Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices",
Value: eth.DefaultConfig.GPO.Percentile,
}
+ WhisperEnabledFlag = cli.BoolFlag{
+ Name: "shh",
+ Usage: "Enable Whisper",
+ }
+ WhisperMaxMessageSizeFlag = cli.IntFlag{
+ Name: "shh.maxmessagesize",
+ Usage: "Max message size accepted",
+ Value: int(whisper.DefaultMaxMessageSize),
+ }
+ WhisperMinPOWFlag = cli.Float64Flag{
+ Name: "shh.pow",
+ Usage: "Minimum POW accepted",
+ Value: whisper.DefaultMinimumPoW,
+ }
)
// MakeDataDir retrieves the currently requested data directory, terminating
@@ -875,11 +889,11 @@ func checkExclusive(ctx *cli.Context, flags ...cli.Flag) {
// SetShhConfig applies shh-related command line flags to the config.
func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
- if ctx.GlobalIsSet(whisper.MaxMessageSizeFlag.Name) {
- cfg.MaxMessageSize = uint32(ctx.GlobalUint(whisper.MaxMessageSizeFlag.Name))
+ if ctx.GlobalIsSet(WhisperMaxMessageSizeFlag.Name) {
+ cfg.MaxMessageSize = uint32(ctx.GlobalUint(WhisperMaxMessageSizeFlag.Name))
}
- if ctx.GlobalIsSet(whisper.MinPOWFlag.Name) {
- cfg.MinimumAcceptedPOW = ctx.GlobalFloat64(whisper.MinPOWFlag.Name)
+ if ctx.GlobalIsSet(WhisperMinPOWFlag.Name) {
+ cfg.MinimumAcceptedPOW = ctx.GlobalFloat64(WhisperMinPOWFlag.Name)
}
}