diff options
author | Vlad <gluk256@gmail.com> | 2018-02-23 18:10:28 +0800 |
---|---|---|
committer | Vlad <gluk256@gmail.com> | 2018-02-23 18:10:28 +0800 |
commit | d7b4b40cb69af0166e24f91cac729d7c07ae65c6 (patch) | |
tree | e2d913c9082d09363d28245777e1d1d8569bee40 /whisper/whisperv6/api.go | |
parent | a1984ce727642b1989657b9eb430562d47f89c70 (diff) | |
download | go-tangerine-d7b4b40cb69af0166e24f91cac729d7c07ae65c6.tar go-tangerine-d7b4b40cb69af0166e24f91cac729d7c07ae65c6.tar.gz go-tangerine-d7b4b40cb69af0166e24f91cac729d7c07ae65c6.tar.bz2 go-tangerine-d7b4b40cb69af0166e24f91cac729d7c07ae65c6.tar.lz go-tangerine-d7b4b40cb69af0166e24f91cac729d7c07ae65c6.tar.xz go-tangerine-d7b4b40cb69af0166e24f91cac729d7c07ae65c6.tar.zst go-tangerine-d7b4b40cb69af0166e24f91cac729d7c07ae65c6.zip |
whisper: light client mode introduced
Diffstat (limited to 'whisper/whisperv6/api.go')
-rw-r--r-- | whisper/whisperv6/api.go | 12 |
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. |