diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2022-07-17 21:51:30 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2022-07-17 22:32:55 +0200 |
commit | 479b63d8c30c0bc6e6475882d7fb573db5dad1f9 (patch) | |
tree | af2ebc889628de1b7c8dfdb3ed64d5733ba00bb4 /src/Network.hs | |
parent | 36eb3a419ec9d0434f55456090e2845d4ac20b58 (diff) |
MonadStorage for context with Storage instance
Diffstat (limited to 'src/Network.hs')
-rw-r--r-- | src/Network.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Network.hs b/src/Network.hs index c9a2d8b..7195129 100644 --- a/src/Network.hs +++ b/src/Network.hs @@ -4,7 +4,7 @@ module Network ( getNextPeerChange, ServerOptions(..), serverIdentity, defaultServerOptions, - Peer, peerServer, + Peer, peerServer, peerStorage, PeerAddress(..), peerAddress, PeerIdentity(..), peerIdentity, PeerChannel(..), @@ -101,7 +101,7 @@ data Peer = Peer , peerServer_ :: Server , peerIdentityVar :: TVar PeerIdentity , peerChannel :: TVar PeerChannel - , peerStorage :: Storage + , peerStorage_ :: Storage , peerInStorage :: PartialStorage , peerOutQueue :: TQueue (Bool, [TransportHeaderItem], TransportPacket) , peerSentPackets :: TVar [SentPacket] @@ -120,6 +120,9 @@ data SentPacket = SentPacket peerServer :: Peer -> Server peerServer = peerServer_ +peerStorage :: Peer -> Storage +peerStorage = peerStorage_ + instance Eq Peer where (==) = (==) `on` peerIdentityVar |