From ac86d1ee599fda157971c79a210fe4d9e3268a27 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Fri, 13 Oct 2023 15:35:48 -0500 Subject: [PATCH] Correct block recording --- src/ZGoBackend.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index e3d0882..763c512 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -1920,7 +1920,8 @@ scanTxNative config pipe = do let filteredTxList = map fromJust $ filter filterTx txList print "checking txs against keys..." mapM_ (checkTx filteredTxList) ownerList - access pipe master (c_dbName config) $ upsertBlock lB + access pipe master (c_dbName config) $ + upsertBlock (last $ catMaybes filteredBlockList) Just lastBlock -> do blockList' <- mapM @@ -1936,7 +1937,8 @@ scanTxNative config pipe = do let filteredTxList = map fromJust $ filter filterTx txList print "checking txs against keys..." mapM_ (checkTx filteredTxList) ownerList - access pipe master (c_dbName config) $ upsertBlock lB + access pipe master (c_dbName config) $ + upsertBlock (last $ catMaybes filteredBlockList) where filterBlock :: Maybe BlockResponse -> Bool filterBlock b = maybe 0 bl_confirmations b >= 5