diff --git a/CHANGELOG.md b/CHANGELOG.md index bf372d6..83933ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `listaccounts` RPC method - `listaddresses` RPC method +### Changed + +- Detection of changes in database schema for automatic re-scan + ## [0.6.0.0-beta] ### Added diff --git a/src/Zenith/DB.hs b/src/Zenith/DB.hs index 3a8f70c..623f5c4 100644 --- a/src/Zenith/DB.hs +++ b/src/Zenith/DB.hs @@ -307,13 +307,11 @@ initDb :: T.Text -- ^ The database path to check -> IO (Either String Bool) initDb dbName = do - print "Start database" j <- try $ PS.runSqlite dbName $ runMigrationQuiet migrateAll :: IO (Either SomeException [T.Text]) case j of - Left e1 -> do - print e1 + Left _e1 -> do pool <- runNoLoggingT $ initPool dbName wallets <- runNoLoggingT $ @@ -345,6 +343,8 @@ initDb dbName = do runNoLoggingT $ PS.retryOnBusy $ flip PS.runSqlPool backupPool $ insertMany_ $ entityVal <$> abook + clearWalletTransactions pool + clearWalletData pool m <- try $ PS.runSqlite dbName $ runMigrationQuiet migrateAll :: IO (Either SomeException [T.Text])