whisper: remove whisper (#21487)
* whisper: remove whisper * Update cmd/geth/config.go Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de> * cmd/geth: warn on enabling whisper + remove more whisper deps * mobile: remove all whisper references Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de> Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
@ -63,7 +63,6 @@ import (
|
||||
"github.com/ethereum/go-ethereum/p2p/nat"
|
||||
"github.com/ethereum/go-ethereum/p2p/netutil"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
|
||||
pcsclite "github.com/gballet/go-libpcsclite"
|
||||
cli "gopkg.in/urfave/cli.v1"
|
||||
)
|
||||
@ -639,12 +638,12 @@ var (
|
||||
WhisperMaxMessageSizeFlag = cli.IntFlag{
|
||||
Name: "shh.maxmessagesize",
|
||||
Usage: "Max message size accepted",
|
||||
Value: int(whisper.DefaultMaxMessageSize),
|
||||
Value: 1024 * 1024,
|
||||
}
|
||||
WhisperMinPOWFlag = cli.Float64Flag{
|
||||
Name: "shh.pow",
|
||||
Usage: "Minimum POW accepted",
|
||||
Value: whisper.DefaultMinimumPoW,
|
||||
Value: 0.2,
|
||||
}
|
||||
WhisperRestrictConnectionBetweenLightClientsFlag = cli.BoolFlag{
|
||||
Name: "shh.restrict-light",
|
||||
@ -1465,15 +1464,12 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) {
|
||||
}
|
||||
|
||||
// SetShhConfig applies shh-related command line flags to the config.
|
||||
func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
|
||||
if ctx.GlobalIsSet(WhisperMaxMessageSizeFlag.Name) {
|
||||
cfg.MaxMessageSize = uint32(ctx.GlobalUint(WhisperMaxMessageSizeFlag.Name))
|
||||
}
|
||||
if ctx.GlobalIsSet(WhisperMinPOWFlag.Name) {
|
||||
cfg.MinimumAcceptedPOW = ctx.GlobalFloat64(WhisperMinPOWFlag.Name)
|
||||
}
|
||||
if ctx.GlobalIsSet(WhisperRestrictConnectionBetweenLightClientsFlag.Name) {
|
||||
cfg.RestrictConnectionBetweenLightClients = true
|
||||
func SetShhConfig(ctx *cli.Context, stack *node.Node) {
|
||||
if ctx.GlobalIsSet(WhisperEnabledFlag.Name) ||
|
||||
ctx.GlobalIsSet(WhisperMaxMessageSizeFlag.Name) ||
|
||||
ctx.GlobalIsSet(WhisperMinPOWFlag.Name) ||
|
||||
ctx.GlobalIsSet(WhisperRestrictConnectionBetweenLightClientsFlag.Name) {
|
||||
log.Warn("Whisper support has been deprecated and the code has been moved to github.com/ethereum/whisper")
|
||||
}
|
||||
}
|
||||
|
||||
@ -1697,13 +1693,6 @@ func RegisterEthService(stack *node.Node, cfg *eth.Config) ethapi.Backend {
|
||||
}
|
||||
}
|
||||
|
||||
// RegisterShhService configures Whisper and adds it to the given node.
|
||||
func RegisterShhService(stack *node.Node, cfg *whisper.Config) {
|
||||
if _, err := whisper.New(stack, cfg); err != nil {
|
||||
Fatalf("Failed to register the Whisper service: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// RegisterEthStatsService configures the Ethereum Stats daemon and adds it to
|
||||
// the given node.
|
||||
func RegisterEthStatsService(stack *node.Node, backend ethapi.Backend, url string) {
|
||||
|
Reference in New Issue
Block a user