aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2017-12-01 19:50:19 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-12-01 19:50:19 +0800
commit20fe92891417652f644fb401d26eed7c9ed6ccac (patch)
treea128c98dc880d62f4a69726511c53637d2287061 /whisper
parent54aeb8e4c0bb9f0e7a6c67258af67df3b266af3d (diff)
downloadgo-tangerine-20fe92891417652f644fb401d26eed7c9ed6ccac.tar
go-tangerine-20fe92891417652f644fb401d26eed7c9ed6ccac.tar.gz
go-tangerine-20fe92891417652f644fb401d26eed7c9ed6ccac.tar.bz2
go-tangerine-20fe92891417652f644fb401d26eed7c9ed6ccac.tar.lz
go-tangerine-20fe92891417652f644fb401d26eed7c9ed6ccac.tar.xz
go-tangerine-20fe92891417652f644fb401d26eed7c9ed6ccac.tar.zst
go-tangerine-20fe92891417652f644fb401d26eed7c9ed6ccac.zip
whisper: rename EnvNonce to Nonce in the v6 Envelope (#15579)
Diffstat (limited to 'whisper')
-rw-r--r--whisper/whisperv6/envelope.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/whisper/whisperv6/envelope.go b/whisper/whisperv6/envelope.go
index a5f4770b0..c93ab84a2 100644
--- a/whisper/whisperv6/envelope.go
+++ b/whisper/whisperv6/envelope.go
@@ -42,7 +42,7 @@ type Envelope struct {
Topic TopicType
AESNonce []byte
Data []byte
- EnvNonce uint64
+ Nonce uint64
pow float64 // Message-specific PoW as described in the Whisper specification.
hash common.Hash // Cached hash of the envelope to avoid rehashing every time.
@@ -70,7 +70,7 @@ func NewEnvelope(ttl uint32, topic TopicType, aesNonce []byte, msg *sentMessage)
Topic: topic,
AESNonce: aesNonce,
Data: msg.Raw,
- EnvNonce: 0,
+ Nonce: 0,
}
if EnvelopeVersion < 256 {
@@ -119,7 +119,7 @@ func (e *Envelope) Seal(options *MessageParams) error {
d := new(big.Int).SetBytes(crypto.Keccak256(buf))
firstBit := math.FirstBitSet(d)
if firstBit > bestBit {
- e.EnvNonce, bestBit = nonce, firstBit
+ e.Nonce, bestBit = nonce, firstBit
if target > 0 && bestBit >= target {
return nil
}
@@ -146,7 +146,7 @@ func (e *Envelope) calculatePoW(diff uint32) {
buf := make([]byte, 64)
h := crypto.Keccak256(e.rlpWithoutNonce())
copy(buf[:32], h)
- binary.BigEndian.PutUint64(buf[56:], e.EnvNonce)
+ binary.BigEndian.PutUint64(buf[56:], e.Nonce)
d := new(big.Int).SetBytes(crypto.Keccak256(buf))
firstBit := math.FirstBitSet(d)
x := gmath.Pow(2, float64(firstBit))