mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-03 13:23:07 +00:00
remove useless nil check when initializing subsystem tracers
This commit is contained in:
parent
fd73973145
commit
958e09a5b3
@ -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) {
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user