rvv041 #82

Merged
pitmutt merged 30 commits from rvv041 into milestone2 2024-06-07 20:03:06 +00:00
3 changed files with 19 additions and 0 deletions
Showing only changes of commit 2fb6747bfb - Show all commits

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
.stack-work/ .stack-work/
*~ *~
dist-newstyle/ dist-newstyle/
zenith.db
zenith.log

View file

@ -246,6 +246,12 @@ share
position Int position Int
UniqueSSPos tx position UniqueSSPos tx position
deriving Show Eq deriving Show Eq
AddressBook
network ZcashNetDB
descrip T.Text
address HexStringDB
UniqueABA address
deriving Show Eq
|] |]
-- * Database functions -- * Database functions
@ -1467,5 +1473,16 @@ readUnifiedAddressDB :: WalletAddress -> Maybe UnifiedAddress
readUnifiedAddressDB = readUnifiedAddressDB =
isValidUnifiedAddress . TE.encodeUtf8 . getUA . walletAddressUAddress isValidUnifiedAddress . TE.encodeUtf8 . getUA . walletAddressUAddress
-- | Get list of external zcash addresses from database
getAdrBook :: ConnectionPool -> ZcashNet -> IO [Entity AddressBook]
getAdrBook pool n =
runNoLoggingT $
PS.retryOnBusy $
flip PS.runSqlPool pool $ do
select $ do
adrbook <- from $ table @AddressBook
where_ (adrbook ^. AddressBookNetwork ==. val (ZcashNetDB n))
pure adrbook
rmdups :: Ord a => [a] -> [a] rmdups :: Ord a => [a] -> [a]
rmdups = map head . group . sort rmdups = map head . group . sort

BIN
zenith.db

Binary file not shown.