aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/api.go
diff options
context:
space:
mode:
authorgluk256 <gluk256@users.noreply.github.com>2018-02-23 21:07:29 +0800
committerGitHub <noreply@github.com>2018-02-23 21:07:29 +0800
commit4702ace5f7bdc3f4bca6cae6532b01e5f21df72c (patch)
tree8cabfbdba6634668237ccb7e9b73f66f63252774 /whisper/whisperv6/api.go
parent89f914c03075012603267d207de0f433740dcd30 (diff)
parentd7b4b40cb69af0166e24f91cac729d7c07ae65c6 (diff)
downloaddexon-4702ace5f7bdc3f4bca6cae6532b01e5f21df72c.tar
dexon-4702ace5f7bdc3f4bca6cae6532b01e5f21df72c.tar.gz
dexon-4702ace5f7bdc3f4bca6cae6532b01e5f21df72c.tar.bz2
dexon-4702ace5f7bdc3f4bca6cae6532b01e5f21df72c.tar.lz
dexon-4702ace5f7bdc3f4bca6cae6532b01e5f21df72c.tar.xz
dexon-4702ace5f7bdc3f4bca6cae6532b01e5f21df72c.tar.zst
dexon-4702ace5f7bdc3f4bca6cae6532b01e5f21df72c.zip
Merge pull request #16172 from gluk256/244-light-client
whisper: light client mode introduced
Diffstat (limited to 'whisper/whisperv6/api.go')
-rw-r--r--whisper/whisperv6/api.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go
index a2c75a41c..f3d9977fa 100644
--- a/whisper/whisperv6/api.go
+++ b/whisper/whisperv6/api.go
@@ -219,6 +219,18 @@ func (api *PublicWhisperAPI) DeleteSymKey(ctx context.Context, id string) bool {
return api.w.DeleteSymKey(id)
}
+// MakeLightClient turns the node into light client, which does not forward any incoming messages.
+func (api *PublicWhisperAPI) MakeLightClient(ctx context.Context) bool {
+ api.w.lightClient = true
+ return api.w.lightClient
+}
+
+// CancelLightClient cancels light client mode.
+func (api *PublicWhisperAPI) CancelLightClient(ctx context.Context) bool {
+ api.w.lightClient = false
+ return !api.w.lightClient
+}
+
//go:generate gencodec -type NewMessage -field-override newMessageOverride -out gen_newmessage_json.go
// NewMessage represents a new whisper message that is posted through the RPC.