mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-05 22:33:10 +00:00
remove unnecessary context in validateSingleTopic
This commit is contained in:
parent
f4d9eeec26
commit
2df9d940bf
@ -309,10 +309,7 @@ loop:
|
|||||||
func (v *validation) validateSingleTopic(val *topicVal, src peer.ID, msg *Message) bool {
|
func (v *validation) validateSingleTopic(val *topicVal, src peer.ID, msg *Message) bool {
|
||||||
select {
|
select {
|
||||||
case val.validateThrottle <- struct{}{}:
|
case val.validateThrottle <- struct{}{}:
|
||||||
ctx, cancel := context.WithCancel(v.p.ctx)
|
res := val.validateMsg(v.p.ctx, src, msg)
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
res := val.validateMsg(ctx, src, msg)
|
|
||||||
<-val.validateThrottle
|
<-val.validateThrottle
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user