whisper: fix empty topic (#15811)

* whisper: fix empty topic

* whisper: add check to matchSingleTopic

* whisper: add tests

* whisper: fix gosimple

* whisper: added lastTopicByte const
This commit is contained in:
b00ris
2018-01-26 14:41:53 +03:00
committed by Péter Szilágyi
parent 4dd0727c39
commit 2ef3815af4
6 changed files with 92 additions and 16 deletions

View File

@ -567,7 +567,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[:])
}