mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
whisper: make the header size a constant
This commit is contained in:
parent
225967a6e3
commit
736e75697d
2 changed files with 3 additions and 1 deletions
|
|
@ -67,6 +67,8 @@ const (
|
|||
|
||||
DefaultTTL = 50 // seconds
|
||||
SynchAllowance = 10 // seconds
|
||||
|
||||
EnvelopeHeaderLength = 20
|
||||
)
|
||||
|
||||
type unknownVersionError uint64
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue