whisper: remove pure

This commit is contained in:
b00ris 2018-05-21 14:54:39 +03:00
parent 971f770087
commit ca0eb7997e
No known key found for this signature in database
GPG key ID: 2F73E159EB73232C
3 changed files with 5 additions and 5 deletions

View file

@ -192,14 +192,14 @@ func (api *PublicWhisperAPI) DeleteSymKey(ctx context.Context, id string) bool {
return api.w.DeleteSymKey(id) return api.w.DeleteSymKey(id)
} }
// MakeLightClient turns the node into pure light client, which does not forward // MakeLightClient turns the node into light client, which does not forward
// any incoming messages, and sends only messages originated in this node. // any incoming messages, and sends only messages originated in this node.
func (api *PublicWhisperAPI) MakeLightClient(ctx context.Context) bool { func (api *PublicWhisperAPI) MakeLightClient(ctx context.Context) bool {
api.w.SetLightClientMode(true) api.w.SetLightClientMode(true)
return true return true
} }
// CancelLightClient cancels pure light client mode. // CancelLightClient cancels light client mode.
func (api *PublicWhisperAPI) CancelLightClient(ctx context.Context) bool { func (api *PublicWhisperAPI) CancelLightClient(ctx context.Context) bool {
api.w.SetLightClientMode(false) api.w.SetLightClientMode(false)
return true return true

View file

@ -132,7 +132,7 @@ func (peer *Peer) handshake() error {
b, err := s.Bool() b, err := s.Bool()
if b && isLightNode && isRestrictedLightNodeConnection { if b && isLightNode && isRestrictedLightNodeConnection {
return fmt.Errorf("peer [%x] is useless: two pure light node communication restricted", peer.ID()) return fmt.Errorf("peer [%x] is useless: two light client communication restricted", peer.ID())
} }
if err := <-errc; err != nil { if err := <-errc; err != nil {

View file

@ -535,7 +535,7 @@ func TestHandshakeWithOldVersionWithoutLightModeFlag(t *testing.T) {
} }
//two light nodes handshake. restriction disabled //two light nodes handshake. restriction disabled
func TestPureLightPeerHandshakeRestrictionOff(t *testing.T) { func TestTwoLightPeerHandshakeRestrictionOff(t *testing.T) {
w1 := Whisper{} w1 := Whisper{}
w1.settings.Store(restrictConnectionBetweenLightClientsIdx, false) w1.settings.Store(restrictConnectionBetweenLightClientsIdx, false)
w1.SetLightClientMode(true) w1.SetLightClientMode(true)
@ -547,7 +547,7 @@ func TestPureLightPeerHandshakeRestrictionOff(t *testing.T) {
} }
//two light nodes handshake. restriction enabled //two light nodes handshake. restriction enabled
func TestPureLightPeerHandshakeError(t *testing.T) { func TestTwoLightPeerHandshakeError(t *testing.T) {
w1 := Whisper{} w1 := Whisper{}
w1.settings.Store(restrictConnectionBetweenLightClientsIdx, true) w1.settings.Store(restrictConnectionBetweenLightClientsIdx, true)
w1.SetLightClientMode(true) w1.SetLightClientMode(true)