Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- belowTarget ∷ (MonadAsync m, MonadTimer m, Ord peeraddr, Hashable peeraddr) ⇒ PeerSelectionActions peeraddr peerconn m → Time → Map peeraddr PeerSharing → MkGuardedDecision peeraddr peerconn m
- aboveTarget ∷ (MonadSTM m, Ord peeraddr, HasCallStack) ⇒ MkGuardedDecision peeraddr peerconn m
Documentation
∷ (MonadAsync m, MonadTimer m, Ord peeraddr, Hashable peeraddr) | |
⇒ PeerSelectionActions peeraddr peerconn m | |
→ Time | 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.