Skip to content

Commit

Permalink
Use block height parameter when fetching payloads during catchup
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Dec 5, 2024
1 parent 50a69fb commit 8aab452
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Chainweb/Sync/WebBlockHeaderStore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ getBlockPayload s candidateStore priority maybeOrigin h = do
pullOrigin _ k Nothing = do
logfun Debug $ taskMsg k "no origin"
return Nothing
pullOrigin _ k (Just origin) = do
pullOrigin bh k (Just origin) = do
let originEnv = setResponseTimeout pullOriginResponseTimeout $ peerInfoClientEnv mgr origin
logfun Debug $ taskMsg k "lookup origin"
!r <- trace traceLogfun (traceLabel "pullOrigin") k 0
$ runClientM (payloadClient v cid k Nothing) originEnv
$ runClientM (payloadClient v cid k (Just bh)) originEnv
case r of
(Right !x) -> do
logfun Debug $ taskMsg k "received from origin"
Expand All @@ -268,11 +268,11 @@ getBlockPayload s candidateStore priority maybeOrigin h = do
-- | Query a block payload via the task queue
--
queryPayloadTask :: BlockHeight -> BlockPayloadHash -> IO (Task ClientEnv PayloadData)
queryPayloadTask _ k = newTask (sshow k) priority $ \logg env -> do
queryPayloadTask bh k = newTask (sshow k) priority $ \logg env -> do
logg @T.Text Debug $ taskMsg k "query remote block payload"
let taskEnv = setResponseTimeout taskResponseTimeout env
!r <- trace traceLogfun (traceLabel "queryPayloadTask") k (let Priority i = priority in i)
$ runClientM (payloadClient v cid k Nothing) taskEnv
$ runClientM (payloadClient v cid k (Just bh)) taskEnv
case r of
(Right !x) -> do
logg @T.Text Debug $ taskMsg k "received remote block payload"
Expand Down

0 comments on commit 8aab452

Please sign in to comment.