mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
whisper: add check to matchSingleTopic
This commit is contained in:
parent
3b2ff9a71d
commit
40f686b21d
2 changed files with 8 additions and 0 deletions
|
|
@ -220,6 +220,10 @@ func matchSingleTopic(topic TopicType, bt []byte) bool {
|
|||
bt = bt[:4]
|
||||
}
|
||||
|
||||
if len(bt) < 4 {
|
||||
return false
|
||||
}
|
||||
|
||||
for j, b := range bt {
|
||||
if topic[j] != b {
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -225,6 +225,10 @@ func matchSingleTopic(topic TopicType, bt []byte) bool {
|
|||
bt = bt[:4]
|
||||
}
|
||||
|
||||
if len(bt) < 4 {
|
||||
return false
|
||||
}
|
||||
|
||||
for j, b := range bt {
|
||||
if topic[j] != b {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Reference in a new issue