Skip to content

Commit cfb7250

Browse files
committed
cmd/geth: print warning when whisper config is present in toml (ethereum#21544)
1 parent 995db18 commit cfb7250

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cmd/XDC/config.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,19 @@ type Bootnodes struct {
8888
Testnet []string
8989
}
9090

91+
// whisper has been deprecated, but clients out there might still have [Shh]
92+
// in their config, which will crash. Cut them some slack by keeping the
93+
// config, and displaying a message that those config switches are ineffectual.
94+
// To be removed circa Q1 2021 -- @gballet.
95+
type whisperDeprecatedConfig struct {
96+
MaxMessageSize uint32 `toml:",omitempty"`
97+
MinimumAcceptedPOW float64 `toml:",omitempty"`
98+
RestrictConnectionBetweenLightClients bool `toml:",omitempty"`
99+
}
100+
91101
type XDCConfig struct {
92102
Eth ethconfig.Config
103+
Shh whisperDeprecatedConfig
93104
Node node.Config
94105
Ethstats ethstatsConfig
95106
XDCX XDCx.Config
@@ -139,6 +150,10 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
139150
if err := loadConfig(file, &cfg); err != nil {
140151
utils.Fatalf("%v", err)
141152
}
153+
154+
if cfg.Shh != (whisperDeprecatedConfig{}) {
155+
log.Warn("Deprecated whisper config detected. Whisper has been moved to github.com/ethereum/whisper")
156+
}
142157
}
143158
if ctx.GlobalIsSet(utils.StakingEnabledFlag.Name) {
144159
cfg.StakeEnable = ctx.GlobalBool(utils.StakingEnabledFlag.Name)

0 commit comments

Comments
 (0)