whisper: Fix interpretation of `to` parameter in `shh_requestMessages` (#16996)

The argument is inclusive rather than exclusive, according to docs.
release/1.8
Pedro Pombeiro 6 years ago committed by Guillaume Ballet
parent f5c7d1c8eb
commit 16e95f33b7
  1. 2
      whisper/mailserver/mailserver.go

@ -118,7 +118,7 @@ func (s *WMailServer) processRequest(peer *whisper.Peer, lower, upper uint32, bl
var err error
var zero common.Hash
kl := NewDbKey(lower, zero)
ku := NewDbKey(upper, zero)
ku := NewDbKey(upper+1, zero) // LevelDB is exclusive, while the Whisper API is inclusive
i := s.db.NewIterator(&util.Range{Start: kl.raw, Limit: ku.raw}, nil)
defer i.Release()

Loading…
Cancel
Save