aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/filter.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/whisperv6/filter.go')
-rw-r--r--whisper/whisperv6/filter.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/whisper/whisperv6/filter.go b/whisper/whisperv6/filter.go
index 2f52dd6b9..a752c7ac9 100644
--- a/whisper/whisperv6/filter.go
+++ b/whisper/whisperv6/filter.go
@@ -221,8 +221,12 @@ func (f *Filter) MatchTopic(topic TopicType) bool {
}
func matchSingleTopic(topic TopicType, bt []byte) bool {
- if len(bt) > 4 {
- bt = bt[:4]
+ if len(bt) > TopicLength {
+ bt = bt[:TopicLength]
+ }
+
+ if len(bt) < TopicLength {
+ return false
}
for j, b := range bt {