mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +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]
|
bt = bt[:4]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(bt) < 4 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
for j, b := range bt {
|
for j, b := range bt {
|
||||||
if topic[j] != b {
|
if topic[j] != b {
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,10 @@ func matchSingleTopic(topic TopicType, bt []byte) bool {
|
||||||
bt = bt[:4]
|
bt = bt[:4]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(bt) < 4 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
for j, b := range bt {
|
for j, b := range bt {
|
||||||
if topic[j] != b {
|
if topic[j] != b {
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue