ouroboros-network- A networking layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred




belowTarget Source #


∷ (MonadAsync m, MonadTimer m, Ord peeraddr, Hashable peeraddr) 
PeerSelectionActions peeraddr peerconn m 

blocked at

Map peeraddr PeerSharing 
MkGuardedDecision peeraddr peerconn m 

If we are below the target of known peers we flip a coin to either get new peers from:

  • inbound connections; or
  • peer share (if we are above the peer share request threshold).

It should be noted if the node is in bootstrap mode (i.e. in a sensitive state) then this monitoring action will be disabled.

aboveTarget ∷ (MonadSTM m, Ord peeraddr, HasCallStack) ⇒ MkGuardedDecision peeraddr peerconn m Source #

If we are above the target of known peers (i.e. cold, warm and hot combined), we drop some of the cold peers but we protect the targetNumberOfRootPeers (from combined sets of local and public root peers). policyPickColdPeersToForget policy is used to pick the peers.