From 8aab4523d11a8c4d07278fe6b89b02141a065375 Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Wed, 4 Dec 2024 11:34:54 -0500 Subject: [PATCH] Use block height parameter when fetching payloads during catchup --- src/Chainweb/Sync/WebBlockHeaderStore.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Chainweb/Sync/WebBlockHeaderStore.hs b/src/Chainweb/Sync/WebBlockHeaderStore.hs index e2b18b59a9..887e669996 100644 --- a/src/Chainweb/Sync/WebBlockHeaderStore.hs +++ b/src/Chainweb/Sync/WebBlockHeaderStore.hs @@ -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" @@ -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"