code cosmetics

reword pushMsg for less indentation nesting.
This commit is contained in:
vyzo 2018-01-13 14:44:33 +02:00
parent 982c4de960
commit fba445bc6d
1 changed files with 10 additions and 10 deletions

View File

@ -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