mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
whisper: remove pure
This commit is contained in:
parent
971f770087
commit
ca0eb7997e
3 changed files with 5 additions and 5 deletions
|
|
@ -192,14 +192,14 @@ func (api *PublicWhisperAPI) DeleteSymKey(ctx context.Context, id string) bool {
|
|||
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.
|
||||
func (api *PublicWhisperAPI) MakeLightClient(ctx context.Context) bool {
|
||||
api.w.SetLightClientMode(true)
|
||||
return true
|
||||
}
|
||||
|
||||
// CancelLightClient cancels pure light client mode.
|
||||
// CancelLightClient cancels light client mode.
|
||||
func (api *PublicWhisperAPI) CancelLightClient(ctx context.Context) bool {
|
||||
api.w.SetLightClientMode(false)
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ func (peer *Peer) handshake() error {
|
|||
|
||||
b, err := s.Bool()
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ func TestHandshakeWithOldVersionWithoutLightModeFlag(t *testing.T) {
|
|||
}
|
||||
|
||||
//two light nodes handshake. restriction disabled
|
||||
func TestPureLightPeerHandshakeRestrictionOff(t *testing.T) {
|
||||
func TestTwoLightPeerHandshakeRestrictionOff(t *testing.T) {
|
||||
w1 := Whisper{}
|
||||
w1.settings.Store(restrictConnectionBetweenLightClientsIdx, false)
|
||||
w1.SetLightClientMode(true)
|
||||
|
|
@ -547,7 +547,7 @@ func TestPureLightPeerHandshakeRestrictionOff(t *testing.T) {
|
|||
}
|
||||
|
||||
//two light nodes handshake. restriction enabled
|
||||
func TestPureLightPeerHandshakeError(t *testing.T) {
|
||||
func TestTwoLightPeerHandshakeError(t *testing.T) {
|
||||
w1 := Whisper{}
|
||||
w1.settings.Store(restrictConnectionBetweenLightClientsIdx, true)
|
||||
w1.SetLightClientMode(true)
|
||||
|
|
|
|||
Loading…
Reference in a new issue