mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
whisper: fix issue in topic list copy
Fixes #16271. What was appeneded was a pointer to an object that changes during the iteration.
This commit is contained in:
parent
85ea9159d0
commit
fd8a2786d4
1 changed files with 4 additions and 3 deletions
|
|
@ -558,9 +558,10 @@ func (api *PublicWhisperAPI) NewMessageFilter(req Criteria) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(req.Topics) > 0 {
|
if len(req.Topics) > 0 {
|
||||||
topics = make([][]byte, 0, len(req.Topics))
|
topics = make([][]byte, len(req.Topics))
|
||||||
for _, topic := range req.Topics {
|
for i, topic := range req.Topics {
|
||||||
topics = append(topics, topic[:])
|
topics = append(topics, make([]byte, 0, len(topic)))
|
||||||
|
copy(topics[i], topic[:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue