-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow BlockSyncer.listen to catch up with the node #71
Conversation
66fb354
to
df20bbe
Compare
@@ -92,6 +94,9 @@ mkReader = do | |||
, \x -> modifyMVar_ ref $ return . (x :) | |||
) | |||
|
|||
flatten :: [TickResult [Block]] -> [Block] | |||
flatten = concat . concat . map toList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe : concat . concatMap toList
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see HLint complained about it. I will fix this, squash and push
df20bbe
to
dd80953
Compare
data TickResult a | ||
= GotChunk !a -- ^ Have a result, and there may be more available. | ||
| Sleep -- ^ There is no result available now, so wait. | ||
deriving (Show, Eq, Foldable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how the Foldable
instance is derived here 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{-# LANGUAGE DeriveFoldable #-}
Please don't merge now. I am trying to resolve issues with building the http bridge first. |
dd80953
to
2751fc5
Compare
just rebased |
It will now process blocks continuously, in chunks, until all the local blocks from the node are done. Then it will start polling. [23] Hlint fix
Relates to #52.
Overview
It will now process blocks continuously, in chunks, until all the local blocks from the node are done. Then it will start polling.