remove useless nil check when initializing subsystem tracers

This commit is contained in:
vyzo 2019-11-04 20:47:19 +02:00
parent fd73973145
commit 958e09a5b3
4 changed files with 4 additions and 12 deletions

View File

@ -40,9 +40,7 @@ func (fs *FloodSubRouter) Protocols() []protocol.ID {
func (fs *FloodSubRouter) Attach(p *PubSub) {
fs.p = p
if p.tracer != nil {
fs.tracer = p.tracer
}
fs.tracer = p.tracer
}
func (fs *FloodSubRouter) AddPeer(p peer.ID, proto protocol.ID) {

View File

@ -74,9 +74,7 @@ func (gs *GossipSubRouter) Protocols() []protocol.ID {
func (gs *GossipSubRouter) Attach(p *PubSub) {
gs.p = p
if p.tracer != nil {
gs.tracer = p.tracer
}
gs.tracer = p.tracer
go gs.heartbeatTimer()
}

View File

@ -40,9 +40,7 @@ func (rs *RandomSubRouter) Protocols() []protocol.ID {
func (rs *RandomSubRouter) Attach(p *PubSub) {
rs.p = p
if p.tracer != nil {
rs.tracer = p.tracer
}
rs.tracer = p.tracer
}
func (rs *RandomSubRouter) AddPeer(p peer.ID, proto protocol.ID) {

View File

@ -92,9 +92,7 @@ func newValidation() *validation {
// workers
func (v *validation) Start(p *PubSub) {
v.p = p
if p.tracer != nil {
v.tracer = p.tracer
}
v.tracer = p.tracer
for i := 0; i < v.validateWorkers; i++ {
go v.validateWorker()
}