Maintenance #106

Merged
pitmutt merged 3 commits from rav002 into milestone4 2024-12-16 16:08:51 +00:00
7 changed files with 47 additions and 90 deletions
Showing only changes of commit f9d8bc577a - Show all commits

View file

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.7.1.0-beta]
## Changed
- Removed workaround to obtain block time
## [0.7.0.0-beta] ## [0.7.0.0-beta]
### Added ### Added

View file

@ -894,26 +894,13 @@ scanZebra dbP zHost zPort b eChan znet = do
_ <- liftIO $ completeSync pool Failed _ <- liftIO $ completeSync pool Failed
liftIO $ BC.writeBChan eChan $ TickMsg e1 liftIO $ BC.writeBChan eChan $ TickMsg e1
Right blk -> do Right blk -> do
r2 <-
liftIO $
makeZebraCall
zHost
zPort
"getblock"
[Data.Aeson.String $ T.pack $ show bl, jsonNumber 0]
case r2 of
Left e2 -> do
_ <- liftIO $ completeSync pool Failed
liftIO $ BC.writeBChan eChan $ TickMsg e2
Right hb -> do
let blockTime = getBlockTime hb
bi <- bi <-
saveBlock pool $ saveBlock pool $
ZcashBlock ZcashBlock
(fromIntegral $ bl_height blk) (fromIntegral $ bl_height blk)
(HexStringDB $ bl_hash blk) (HexStringDB $ bl_hash blk)
(fromIntegral $ bl_confirmations blk) (fromIntegral $ bl_confirmations blk)
blockTime (fromIntegral $ bl_time blk)
(ZcashNetDB znet) (ZcashNetDB znet)
mapM_ (processTx zHost zPort bi pool) $ bl_txs blk mapM_ (processTx zHost zPort bi pool) $ bl_txs blk
liftIO $ BC.writeBChan eChan $ TickVal step liftIO $ BC.writeBChan eChan $ TickVal step

View file

@ -1729,26 +1729,13 @@ scanZebra dbPath zHost zPort net sendMsg = do
_ <- completeSync pool Failed _ <- completeSync pool Failed
sendMsg (ShowError $ showt e1) sendMsg (ShowError $ showt e1)
Right blk -> do Right blk -> do
r2 <-
liftIO $
makeZebraCall
zHost
zPort
"getblock"
[Data.Aeson.String $ showt bl, jsonNumber 0]
case r2 of
Left e2 -> do
_ <- completeSync pool Failed
sendMsg (ShowError $ showt e2)
Right hb -> do
let blockTime = getBlockTime hb
bi <- bi <-
saveBlock pool $ saveBlock pool $
ZcashBlock ZcashBlock
(fromIntegral $ bl_height blk) (fromIntegral $ bl_height blk)
(HexStringDB $ bl_hash blk) (HexStringDB $ bl_hash blk)
(fromIntegral $ bl_confirmations blk) (fromIntegral $ bl_confirmations blk)
blockTime (fromIntegral $ bl_time blk)
(ZcashNetDB net) (ZcashNetDB net)
mapM_ (processTx zHost zPort bi pool) $ bl_txs blk mapM_ (processTx zHost zPort bi pool) $ bl_txs blk
sendMsg (SyncVal step) sendMsg (SyncVal step)

View file

@ -932,22 +932,12 @@ scanZebra dbPath zHost zPort net = do
case r of case r of
Left _ -> completeSync pool Failed Left _ -> completeSync pool Failed
Right blk -> do Right blk -> do
r2 <-
makeZebraCall
zHost
zPort
"getblock"
[Data.Aeson.String $ T.pack (show bl), jsonNumber 0]
case r2 of
Left _ -> completeSync pool Failed
Right hb -> do
let blockTime = getBlockTime hb
bi <- bi <-
saveBlock pool $ saveBlock pool $
ZcashBlock ZcashBlock
(fromIntegral $ bl_height blk) (fromIntegral $ bl_height blk)
(HexStringDB $ bl_hash blk) (HexStringDB $ bl_hash blk)
(fromIntegral $ bl_confirmations blk) (fromIntegral $ bl_confirmations blk)
blockTime (fromIntegral $ bl_time blk)
(ZcashNetDB net) (ZcashNetDB net)
mapM_ (processTx zHost zPort bi pool) $ bl_txs blk mapM_ (processTx zHost zPort bi pool) $ bl_txs blk

View file

@ -133,26 +133,13 @@ processBlock host port pool pg net b = do
_ <- completeSync pool Failed _ <- completeSync pool Failed
liftIO $ throwIO $ userError e liftIO $ throwIO $ userError e
Right blk -> do Right blk -> do
r2 <-
liftIO $
makeZebraCall
host
port
"getblock"
[Data.Aeson.String $ T.pack $ show b, jsonNumber 0]
case r2 of
Left e2 -> do
_ <- completeSync pool Failed
liftIO $ throwIO $ userError e2
Right hb -> do
let blockTime = getBlockTime hb
bi <- bi <-
saveBlock pool $ saveBlock pool $
ZcashBlock ZcashBlock
(fromIntegral $ bl_height blk) (fromIntegral $ bl_height blk)
(HexStringDB $ bl_hash blk) (HexStringDB $ bl_hash blk)
(fromIntegral $ bl_confirmations blk) (fromIntegral $ bl_confirmations blk)
blockTime (fromIntegral $ bl_time blk)
net net
mapM_ (processTx host port bi pool) $ bl_txs blk mapM_ (processTx host port bi pool) $ bl_txs blk
liftIO $ tick pg liftIO $ tick pg

@ -1 +1 @@
Subproject commit d45bd7dcf3c3cf4e893900a1774d24b14bf56591 Subproject commit 4289a9ded67ef2ca432abc412934fb5b8b59a9cf

View file

@ -1,6 +1,6 @@
cabal-version: 3.0 cabal-version: 3.0
name: zenith name: zenith
version: 0.7.0.0-beta version: 0.7.1.0-beta
license: MIT license: MIT
license-file: LICENSE license-file: LICENSE
author: Rene Vergara author: Rene Vergara