diff --git a/whisper/whisperv5/message_test.go b/whisper/whisperv5/message_test.go index 280670880e..66c969b5e4 100644 --- a/whisper/whisperv5/message_test.go +++ b/whisper/whisperv5/message_test.go @@ -330,13 +330,13 @@ func TestRlpEncode(t *testing.T) { t.Fatalf("wrapped with zero key, seed: %d.", seed) } - rlpEncoded, err := rlp.EncodeToBytes(env) + raw, err := rlp.EncodeToBytes(env) if err != nil { t.Fatalf("RLP encode failed: %s.", err) } var decoded Envelope - err = decoded.DecodeBytes(rlpEncoded) + rlp.DecodeBytes(raw, &decoded) if err != nil { t.Fatalf("RLP decode failed: %s.", err) } diff --git a/whisper/whisperv5/whisper.go b/whisper/whisperv5/whisper.go index 789adbdb3e..5641c7b9ad 100644 --- a/whisper/whisperv5/whisper.go +++ b/whisper/whisperv5/whisper.go @@ -142,6 +142,10 @@ func (w *Whisper) SendP2PMessage(peerID []byte, envelope *Envelope) error { return p2p.Send(p.ws, p2pCode, envelope) } +func (w *Whisper) SendP2PDirect(peer *Peer, envelope *Envelope) error { + return p2p.Send(peer.ws, p2pCode, envelope) +} + // NewIdentity generates a new cryptographic identity for the client, and injects // it into the known identities for message decryption. func (w *Whisper) NewIdentity() *ecdsa.PrivateKey {