diff --git a/whisper/whisperv6/doc.go b/whisper/whisperv6/doc.go index 6ff378b23e..64925ba48b 100644 --- a/whisper/whisperv6/doc.go +++ b/whisper/whisperv6/doc.go @@ -67,6 +67,8 @@ const ( DefaultTTL = 50 // seconds SynchAllowance = 10 // seconds + + EnvelopeHeaderLength = 20 ) type unknownVersionError uint64 diff --git a/whisper/whisperv6/envelope.go b/whisper/whisperv6/envelope.go index e7d0f1f858..26d2c2af12 100644 --- a/whisper/whisperv6/envelope.go +++ b/whisper/whisperv6/envelope.go @@ -50,7 +50,7 @@ type Envelope struct { // size returns the size of envelope as it is sent (i.e. public fields only) func (e *Envelope) size() int { - return 20 + len(e.Version) + len(e.Data) + return EnvelopeHeaderLength + len(e.Version) + len(e.Data) } // rlpWithoutNonce returns the RLP encoded envelope contents, except the nonce.