Skip to content

Commit

Permalink
Implement onConnectionEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
ffakenz committed Apr 17, 2024
1 parent 74c5e61 commit 4524157
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hydra-node/src/Hydra/HeadLogic.hs
Expand Up @@ -88,7 +88,7 @@ import Hydra.Ledger (
applyTransactions,
txId,
)
import Hydra.Network.Message (Message (..), NetworkMessage (..), Connectivity)
import Hydra.Network.Message (Connectivity (..), Message (..), NetworkMessage (..))
import Hydra.OnChainId (OnChainId)
import Hydra.Party (Party (vkey))
import Hydra.Snapshot (ConfirmedSnapshot (..), Snapshot (..), SnapshotNumber, getSnapshot)
Expand All @@ -97,7 +97,11 @@ defaultTTL :: TTL
defaultTTL = 5

onConnectionEvent :: Connectivity -> Outcome tx
onConnectionEvent _ = noop
onConnectionEvent = \case
Connected{nodeId} ->
causes [ClientEffect (ServerOutput.PeerConnected nodeId)]
Disconnected{nodeId} ->
causes [ClientEffect (ServerOutput.PeerDisconnected nodeId)]

-- * The Coordinated Head protocol

Expand Down

0 comments on commit 4524157

Please sign in to comment.