Fix display of last block scanned

This commit is contained in:
Rene Vergara 2024-04-24 09:04:56 -05:00
parent 07c1b85829
commit 53c18a833b
Signed by: pitmutt
GPG Key ID: 65122AD495A7F5B2
1 changed files with 8 additions and 2 deletions

View File

@ -614,7 +614,10 @@ runZenithCLI config = do
if not (null addrList)
then getUserTx dbFilePath $ entityKey $ head addrList
else return []
block <- getMaxWalletBlock dbFilePath
let block =
if not (null walList)
then zcashWalletLastSync $ entityVal $ head walList
else 0
bal <-
if not (null accList)
then getBalance dbFilePath $ entityKey $ head accList
@ -658,6 +661,7 @@ refreshWallet s = do
Just (_j, w1) -> return w1
Just (_k, w) -> return w
aL <- getAccounts (s ^. dbPath) $ entityKey selWallet
let bl = zcashWalletLastSync $ entityVal selWallet
addrL <-
if not (null aL)
then getAddresses (s ^. dbPath) $ entityKey $ head aL
@ -674,7 +678,9 @@ refreshWallet s = do
let addrL' = L.listReplace (Vec.fromList addrL) (Just 0) (s ^. addresses)
let txL' = L.listReplace (Vec.fromList txL) (Just 0) (s ^. transactions)
return $
(s & accounts .~ aL') & balance .~ bal & addresses .~ addrL' & transactions .~
(s & accounts .~ aL') & syncBlock .~ bl & balance .~ bal & addresses .~
addrL' &
transactions .~
txL' &
msg .~
"Switched to wallet: " ++