mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-03 08:34:49 +00:00
cleanups
This commit is contained in:
parent
3a657135dc
commit
680dcfd9cb
@ -19,8 +19,7 @@ import pubsub,
|
||||
../../peerinfo,
|
||||
../../stream/connection,
|
||||
../../peer,
|
||||
../../errors,
|
||||
../../utility
|
||||
../../errors
|
||||
|
||||
logScope:
|
||||
topics = "gossipsub"
|
||||
@ -55,7 +54,6 @@ type
|
||||
heartbeatFut: Future[void] # cancellation future for heartbeat interval
|
||||
heartbeatRunning: bool
|
||||
heartbeatLock: AsyncLock # heartbeat lock to prevent two consecutive concurrent heartbeats
|
||||
subLock: AsyncLock
|
||||
|
||||
declareGauge(libp2p_gossipsub_peers_per_topic_mesh, "gossipsub peers per topic in mesh", labels = ["topic"])
|
||||
declareGauge(libp2p_gossipsub_peers_per_topic_fanout, "gossipsub peers per topic in fanout", labels = ["topic"])
|
||||
@ -548,4 +546,3 @@ method initPubSub*(g: GossipSub) =
|
||||
g.gossip = initTable[string, seq[ControlIHave]]() # pending gossip
|
||||
g.control = initTable[string, ControlMessage]() # pending control messages
|
||||
g.heartbeatLock = newAsyncLock()
|
||||
g.subLock = newAsyncLock()
|
||||
|
@ -39,7 +39,7 @@ proc waitSub(sender, receiver: auto; key: string) {.async, gcsafe.} =
|
||||
(not fsub.fanout.hasKey(key) or
|
||||
not fsub.fanout[key].contains(receiver.peerInfo.id)):
|
||||
trace "waitSub sleeping..."
|
||||
await sleepAsync(100.millis)
|
||||
await sleepAsync(1.seconds)
|
||||
dec ceil
|
||||
doAssert(ceil > 0, "waitSub timeout!")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user