diff --git a/floodsub.go b/floodsub.go index 63b4491..3690f62 100644 --- a/floodsub.go +++ b/floodsub.go @@ -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) { diff --git a/gossipsub.go b/gossipsub.go index e65f782..6327dfa 100644 --- a/gossipsub.go +++ b/gossipsub.go @@ -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() } diff --git a/randomsub.go b/randomsub.go index 700e420..ffbfc62 100644 --- a/randomsub.go +++ b/randomsub.go @@ -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) { diff --git a/validation.go b/validation.go index 164bfa9..bef86da 100644 --- a/validation.go +++ b/validation.go @@ -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() }