From 2ef3815af41c7a12dd798416b4a5ae74c09706c8 Mon Sep 17 00:00:00 2001 From: b00ris Date: Fri, 26 Jan 2018 14:41:53 +0300 Subject: whisper: fix empty topic (#15811) * whisper: fix empty topic * whisper: add check to matchSingleTopic * whisper: add tests * whisper: fix gosimple * whisper: added lastTopicByte const --- whisper/whisperv5/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'whisper/whisperv5/api.go') diff --git a/whisper/whisperv5/api.go b/whisper/whisperv5/api.go index 96c4b0e6c..b4494d0d6 100644 --- a/whisper/whisperv5/api.go +++ b/whisper/whisperv5/api.go @@ -562,7 +562,7 @@ func (api *PublicWhisperAPI) NewMessageFilter(req Criteria) (string, error) { } if len(req.Topics) > 0 { - topics = make([][]byte, 1) + topics = make([][]byte, 0, len(req.Topics)) for _, topic := range req.Topics { topics = append(topics, topic[:]) } -- cgit v1.2.3