From 3b2ff9a71d398fdaab078f237890ba7e46b2e8d4 Mon Sep 17 00:00:00 2001 From: b00ris Date: Thu, 4 Jan 2018 23:58:19 +0300 Subject: [PATCH] whisper: fix empty topic --- whisper/whisperv5/api.go | 2 +- whisper/whisperv6/api.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/whisper/whisperv5/api.go b/whisper/whisperv5/api.go index 96c4b0e6c4..7fd76ee5b0 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, 1) for _, topic := range req.Topics { topics = append(topics, topic[:]) } diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index 3dddb69539..0cfab7cba2 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/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, 1) for _, topic := range req.Topics { topics = append(topics, topic[:]) }