aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/main.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-04-10 20:53:21 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-04-10 20:53:21 +0800
commit7d8ce53eca90a6e93e49d584a2cff5e39aea40c0 (patch)
tree1f42e76be9c66a55407741aa15aa659fdf408850 /whisper/main.go
parent7e54a9c07f10ff16aabfe8bd3944c9309d4efc06 (diff)
downloaddexon-7d8ce53eca90a6e93e49d584a2cff5e39aea40c0.tar
dexon-7d8ce53eca90a6e93e49d584a2cff5e39aea40c0.tar.gz
dexon-7d8ce53eca90a6e93e49d584a2cff5e39aea40c0.tar.bz2
dexon-7d8ce53eca90a6e93e49d584a2cff5e39aea40c0.tar.lz
dexon-7d8ce53eca90a6e93e49d584a2cff5e39aea40c0.tar.xz
dexon-7d8ce53eca90a6e93e49d584a2cff5e39aea40c0.tar.zst
dexon-7d8ce53eca90a6e93e49d584a2cff5e39aea40c0.zip
whisper: polish the messages, fix some bugs, tests
Bugs fixed: - Use randomly generated flags as the spec required. - During envelope opening check the first bit only for signature.
Diffstat (limited to 'whisper/main.go')
-rw-r--r--whisper/main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/whisper/main.go b/whisper/main.go
index 643644ee6..6a089f894 100644
--- a/whisper/main.go
+++ b/whisper/main.go
@@ -69,10 +69,10 @@ func selfSend(shh *whisper.Whisper, payload []byte) error {
})
// Wrap the payload and encrypt it
msg := whisper.NewMessage(payload)
- envelope, err := msg.Seal(whisper.DefaultPow, whisper.Opts{
- Ttl: whisper.DefaultTtl,
+ envelope, err := msg.Wrap(whisper.DefaultPow, whisper.Options{
From: id,
To: &id.PublicKey,
+ TTL: whisper.DefaultTimeToLive,
})
if err != nil {
return fmt.Errorf("failed to seal message: %v", err)