Skip to content

Commit d7f02b4

Browse files
gballetholiman
andauthored
cmd/geth: print warning when whisper config is present in toml (#21544)
* cmd/geth: print warning when whisper config is present in toml * Update cmd/geth/config.go Co-authored-by: Martin Holst Swende <martin@swende.se>
1 parent 1167639 commit d7f02b4

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎cmd/geth/config.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,19 @@ type ethstatsConfig struct {
7373
URL string `toml:",omitempty"`
7474
}
7575

76+
// whisper has been deprecated, but clients out there might still have [Shh]
77+
// in their config, which will crash. Cut them some slack by keeping the
78+
// config, and displaying a message that those config switches are ineffectual.
79+
// To be removed circa Q1 2021 -- @gballet.
80+
type whisperDeprecatedConfig struct {
81+
MaxMessageSize uint32 `toml:",omitempty"`
82+
MinimumAcceptedPOW float64 `toml:",omitempty"`
83+
RestrictConnectionBetweenLightClients bool `toml:",omitempty"`
84+
}
85+
7686
type gethConfig struct {
7787
Eth eth.Config
88+
Shh whisperDeprecatedConfig
7889
Node node.Config
7990
Ethstats ethstatsConfig
8091
}
@@ -117,6 +128,10 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
117128
if err := loadConfig(file, &cfg); err != nil {
118129
utils.Fatalf("%v", err)
119130
}
131+
132+
if cfg.Shh != (whisperDeprecatedConfig{}) {
133+
log.Warn("Deprecated whisper config detected. Whisper has been moved to github.com/ethereum/whisper")
134+
}
120135
}
121136

122137
// Apply flags.

0 commit comments

Comments
 (0)