Skip to content

Commit

Permalink
cmd/geth: print warning when whisper config is present in toml (ether…
Browse files Browse the repository at this point in the history
  • Loading branch information
JukLee0ira committed Nov 13, 2024
1 parent 995db18 commit cfb7250
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/XDC/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,19 @@ type Bootnodes struct {
Testnet []string
}

// whisper has been deprecated, but clients out there might still have [Shh]
// in their config, which will crash. Cut them some slack by keeping the
// config, and displaying a message that those config switches are ineffectual.
// To be removed circa Q1 2021 -- @gballet.
type whisperDeprecatedConfig struct {
MaxMessageSize uint32 `toml:",omitempty"`
MinimumAcceptedPOW float64 `toml:",omitempty"`
RestrictConnectionBetweenLightClients bool `toml:",omitempty"`
}

type XDCConfig struct {
Eth ethconfig.Config
Shh whisperDeprecatedConfig
Node node.Config
Ethstats ethstatsConfig
XDCX XDCx.Config
Expand Down Expand Up @@ -139,6 +150,10 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
if err := loadConfig(file, &cfg); err != nil {
utils.Fatalf("%v", err)
}

if cfg.Shh != (whisperDeprecatedConfig{}) {
log.Warn("Deprecated whisper config detected. Whisper has been moved to github.com/ethereum/whisper")
}
}
if ctx.GlobalIsSet(utils.StakingEnabledFlag.Name) {
cfg.StakeEnable = ctx.GlobalBool(utils.StakingEnabledFlag.Name)
Expand Down

0 comments on commit cfb7250

Please sign in to comment.