mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
whisper: minor refactoring
This commit is contained in:
parent
b493e462aa
commit
90cf7a1727
2 changed files with 10 additions and 0 deletions
|
|
@ -51,6 +51,7 @@ type Envelope struct {
|
||||||
|
|
||||||
// size returns the size of envelope as it is sent (i.e. public fields only)
|
// size returns the size of envelope as it is sent (i.e. public fields only)
|
||||||
func (e *Envelope) size() int {
|
func (e *Envelope) size() int {
|
||||||
|
const EnvelopeHeaderLength = 20
|
||||||
return EnvelopeHeaderLength + len(e.Data)
|
return EnvelopeHeaderLength + len(e.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1067,3 +1067,12 @@ func addBloom(a, b []byte) []byte {
|
||||||
}
|
}
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isBloomFilterEqual(a, b []byte) bool {
|
||||||
|
for i := 0; i < bloomFilterSize; i++ {
|
||||||
|
if a[i] != b[i] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue