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[:]) }