mirror of
https://github.com/status-im/status-go.git
synced 2025-02-20 10:48:36 +00:00
fix: ensure db opened in UpdateNodeConfigFleet (#4822)
This commit is contained in:
parent
c5371bd3a5
commit
4fb27ec53a
@ -624,7 +624,7 @@ func (b *GethStatusBackend) loginAccount(request *requests.Login) error {
|
|||||||
|
|
||||||
defaultCfg.WalletConfig = buildWalletConfig(&request.WalletSecretsConfig)
|
defaultCfg.WalletConfig = buildWalletConfig(&request.WalletSecretsConfig)
|
||||||
|
|
||||||
err = b.UpdateNodeConfigFleet(defaultCfg)
|
err = b.UpdateNodeConfigFleet(acc, password, defaultCfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -697,11 +697,16 @@ func (b *GethStatusBackend) loginAccount(request *requests.Login) error {
|
|||||||
// UpdateNodeConfigFleet loads the fleet from the settings and updates the node configuration
|
// UpdateNodeConfigFleet loads the fleet from the settings and updates the node configuration
|
||||||
// If the fleet in settings is empty, or not supported anymore, it will be overridden with the default fleet.
|
// If the fleet in settings is empty, or not supported anymore, it will be overridden with the default fleet.
|
||||||
// In that case settings fleet value remain the same, only runtime node configuration is updated.
|
// In that case settings fleet value remain the same, only runtime node configuration is updated.
|
||||||
func (b *GethStatusBackend) UpdateNodeConfigFleet(config *params.NodeConfig) error {
|
func (b *GethStatusBackend) UpdateNodeConfigFleet(acc multiaccounts.Account, password string, config *params.NodeConfig) error {
|
||||||
if config == nil {
|
if config == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err := b.ensureDBsOpened(acc, password)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
accountSettings, err := b.GetSettings()
|
accountSettings, err := b.GetSettings()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -231,7 +231,7 @@ func login(accountData, password, configJSON string) error {
|
|||||||
|
|
||||||
api.RunAsync(func() error {
|
api.RunAsync(func() error {
|
||||||
log.Debug("start a node with account", "key-uid", account.KeyUID)
|
log.Debug("start a node with account", "key-uid", account.KeyUID)
|
||||||
err := statusBackend.UpdateNodeConfigFleet(&conf)
|
err := statusBackend.UpdateNodeConfigFleet(account, password, &conf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user