fix(statusd)_: proper db initialization for imported accounts
This commit is contained in:
parent
0791112404
commit
ccc3e62ce6
|
@ -251,15 +251,9 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
appDB, walletDB, err := openDatabases(config.DataDir + "/" + installationID.String())
|
||||
if err != nil {
|
||||
log.Error("failed to open databases")
|
||||
return
|
||||
}
|
||||
|
||||
options := []protocol.Option{
|
||||
protocol.WithDatabase(appDB),
|
||||
protocol.WithWalletDatabase(walletDB),
|
||||
protocol.WithDatabase(backend.StatusNode().GetAppDB()),
|
||||
protocol.WithWalletDatabase(backend.StatusNode().GetWalletDB()),
|
||||
protocol.WithTorrentConfig(&config.TorrentConfig),
|
||||
protocol.WithWalletConfig(&config.WalletConfig),
|
||||
protocol.WithAccountManager(backend.AccountManager()),
|
||||
|
|
|
@ -690,6 +690,10 @@ func (n *StatusNode) SetAppDB(db *sql.DB) {
|
|||
n.appDB = db
|
||||
}
|
||||
|
||||
func (n *StatusNode) GetAppDB() *sql.DB {
|
||||
return n.appDB
|
||||
}
|
||||
|
||||
func (n *StatusNode) SetMultiaccountsDB(db *multiaccounts.Database) {
|
||||
n.multiaccountsDB = db
|
||||
}
|
||||
|
@ -697,3 +701,7 @@ func (n *StatusNode) SetMultiaccountsDB(db *multiaccounts.Database) {
|
|||
func (n *StatusNode) SetWalletDB(db *sql.DB) {
|
||||
n.walletDB = db
|
||||
}
|
||||
|
||||
func (n *StatusNode) GetWalletDB() *sql.DB {
|
||||
return n.walletDB
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue