From 489721ec0df47ad20dafb171d115e2d841e286c2 Mon Sep 17 00:00:00 2001 From: dreacot Date: Thu, 24 Oct 2024 17:57:27 +0100 Subject: [PATCH] use badgerdb on mobile devices --- libwallet/assets_manager.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libwallet/assets_manager.go b/libwallet/assets_manager.go index 176a9f087..081327b32 100644 --- a/libwallet/assets_manager.go +++ b/libwallet/assets_manager.go @@ -38,6 +38,9 @@ const LogFilename = "cryptopower.log" // assetIdentifier use for listen balance of all wallet changed const assetIdentifier = "assets_manager" +const BoltDB = "bdb" // Bolt db driver +const BadgerDB = "badgerdb" // Badger db driver + // Assets is a struct that holds all the assets supported by the wallet. type Assets struct { DCR struct { @@ -139,7 +142,10 @@ func NewAssetsManager(rootDir, logDir string, netType utils.NetworkType, dexTest } // validate the network type before proceeding to initialize the othe fields. - dbDriver := "bdb" // TODO: Should be a constant. + dbDriver := BOLT_DB + if appos.Current().IsMobile() { + dbDriver = BADGER_DB + } mgr, err := initializeAssetsFields(rootDir, dbDriver, logDir, netType, dexTestAddr) if err != nil { return nil, err