RPC Server #103

Merged
pitmutt merged 129 commits from rav001 into milestone3 2024-11-21 15:30:22 +00:00
Showing only changes of commit 5fbb5c865b - Show all commits

View file

@ -878,7 +878,6 @@ scanZebra dbP zHost zPort b eChan znet = do
liftIO $ BC.writeBChan eChan $ TickMsg "startSync" liftIO $ BC.writeBChan eChan $ TickMsg "startSync"
return () return ()
else do else do
liftIO $ BC.writeBChan eChan $ TickVal 1.0
liftIO $ BC.writeBChan eChan $ TickMsg "startSync" liftIO $ BC.writeBChan eChan $ TickMsg "startSync"
where where
processBlock :: ConnectionPool -> Float -> Int -> IO () processBlock :: ConnectionPool -> Float -> Int -> IO ()
@ -928,36 +927,34 @@ appEvent (BT.AppEvent t) = do
case s ^. displayBox of case s ^. displayBox of
AddrDisplay -> return () AddrDisplay -> return ()
MsgDisplay -> do MsgDisplay -> do
if m == "startSync" when (m == "startSync") $ do
then do selWallet <-
selWallet <- do case L.listSelectedElement $ s ^. wallets of
do case L.listSelectedElement $ s ^. wallets of Nothing -> do
Nothing -> do let fWall =
let fWall = L.listSelectedElement $
L.listSelectedElement $ L.listMoveToBeginning $ s ^. wallets
L.listMoveToBeginning $ s ^. wallets case fWall of
case fWall of Nothing -> throw $ userError "Failed to select wallet"
Nothing -> throw $ userError "Failed to select wallet" Just (_j, w1) -> return w1
Just (_j, w1) -> return w1 Just (_k, w) -> return w
Just (_k, w) -> return w _ <-
_ <- liftIO $
liftIO $ runStderrLoggingT $
runStderrLoggingT $ syncWallet
syncWallet (Config
(Config (s ^. dbPath)
(s ^. dbPath) (s ^. zebraHost)
(s ^. zebraHost) (s ^. zebraPort)
(s ^. zebraPort) "user"
"user" "pwd"
"pwd" 8080)
8080) selWallet
selWallet updatedState <- BT.get
updatedState <- BT.get ns <- liftIO $ refreshWallet updatedState
ns <- liftIO $ refreshWallet updatedState BT.put ns
BT.put ns BT.modify $ set msg ""
BT.modify $ set msg "" BT.modify $ set displayBox BlankDisplay
BT.modify $ set displayBox BlankDisplay
else return ()
PhraseDisplay -> return () PhraseDisplay -> return ()
TxDisplay -> return () TxDisplay -> return ()
TxIdDisplay -> return () TxIdDisplay -> return ()