Skip to content

Commit

Permalink
More comments about watchNodeTip in byron and jormungandr
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Jun 29, 2020
1 parent baaf5d5 commit 7532fab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/byron/src/Cardano/Wallet/Byron/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,8 @@ withNetworkLayer tr np addrInfo versionData action = do
_stakeDistribution =
notImplemented "stakeDistribution"

-- At the moment it's not necessasy to implement this method unless
-- monitoring a reward account.
_watchNodeTip =
notImplemented "stakeDistribution"
notImplemented "watchNodeTip"

-- | Type representing a network client running two mini-protocols to sync
-- from the chain and, submit transactions.
Expand Down
4 changes: 4 additions & 0 deletions lib/jormungandr/src/Cardano/Wallet/Jormungandr/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,10 @@ mkRawNetworkLayer np batchSize st tipNotify j = NetworkLayer
_ ->
RollBackward $ Cursor emptyBlockHeaders

-- NOTE: Because the jormungandr REST API is a polling API, this relies on
-- another thread (e.g. the chain 'follow' operation) to be periodically
-- calling 'getNodeTip' to drive updates. This only works because the sole
-- user of 'watchNodeTip' is 'manageRewardBalance'.
_watchNodeTip cb = do
watcher <- liftIO . atomically $ dupTChan tipNotify
prevVar <- liftIO $ newIORef Nothing
Expand Down

0 comments on commit 7532fab

Please sign in to comment.