code cosmetics
reword pushMsg for less indentation nesting.
This commit is contained in:
parent
982c4de960
commit
fba445bc6d
20
floodsub.go
20
floodsub.go
|
@ -360,19 +360,19 @@ func (p *PubSub) pushMsg(subs []*Subscription, src peer.ID, msg *Message) {
|
|||
}
|
||||
}
|
||||
|
||||
if !needval {
|
||||
go func() {
|
||||
p.sendMsg <- sendReq{
|
||||
from: src,
|
||||
msg: msg,
|
||||
}
|
||||
}()
|
||||
if needval {
|
||||
// validation is asynchronous
|
||||
// XXX vyzo: do we want a global validation throttle here?
|
||||
go p.validate(subs, src, msg)
|
||||
return
|
||||
}
|
||||
|
||||
// validation is asynchronous
|
||||
// XXX vyzo: do we want a global validation throttle here?
|
||||
go p.validate(subs, src, msg)
|
||||
go func() {
|
||||
p.sendMsg <- sendReq{
|
||||
from: src,
|
||||
msg: msg,
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// validate performs validation and only sends the message if all validators succeed
|
||||
|
|
Loading…
Reference in New Issue