aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/message.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/whisperv6/message.go')
-rw-r--r--whisper/whisperv6/message.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/whisper/whisperv6/message.go b/whisper/whisperv6/message.go
index f8df50336..b5c8279b1 100644
--- a/whisper/whisperv6/message.go
+++ b/whisper/whisperv6/message.go
@@ -33,7 +33,8 @@ import (
"github.com/ethereum/go-ethereum/log"
)
-// Options specifies the exact way a message should be wrapped into an Envelope.
+// MessageParams specifies the exact way a message should be wrapped
+// into an Envelope.
type MessageParams struct {
TTL uint32
Src *ecdsa.PrivateKey
@@ -86,8 +87,8 @@ func (msg *ReceivedMessage) isAsymmetricEncryption() bool {
return msg.Dst != nil
}
-// NewMessage creates and initializes a non-signed, non-encrypted Whisper message.
-func NewSentMessage(params *MessageParams) (*sentMessage, error) {
+// NewSentMessage creates and initializes a non-signed, non-encrypted Whisper message.
+func newSentMessage(params *MessageParams) (*sentMessage, error) {
msg := sentMessage{}
msg.Raw = make([]byte, 1, len(params.Payload)+len(params.Padding)+signatureLength+padSizeLimit)
msg.Raw[0] = 0 // set all the flags to zero
@@ -341,7 +342,8 @@ func (msg *ReceivedMessage) extractPadding(end int) (int, bool) {
return paddingSize, true
}
-// Recover retrieves the public key of the message signer.
+// SigToPubKey returns the public key associated to the message's
+// signature.
func (msg *ReceivedMessage) SigToPubKey() *ecdsa.PublicKey {
defer func() { recover() }() // in case of invalid signature