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)
|
||||
|
||||
err = b.UpdateNodeConfigFleet(defaultCfg)
|
||||
err = b.UpdateNodeConfigFleet(acc, password, defaultCfg)
|
||||
if err != nil {
|
||||
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
|
||||
// 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.
|
||||
func (b *GethStatusBackend) UpdateNodeConfigFleet(config *params.NodeConfig) error {
|
||||
func (b *GethStatusBackend) UpdateNodeConfigFleet(acc multiaccounts.Account, password string, config *params.NodeConfig) error {
|
||||
if config == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
err := b.ensureDBsOpened(acc, password)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
accountSettings, err := b.GetSettings()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -231,7 +231,7 @@ func login(accountData, password, configJSON string) error {
|
|||
|
||||
api.RunAsync(func() error {
|
||||
log.Debug("start a node with account", "key-uid", account.KeyUID)
|
||||
err := statusBackend.UpdateNodeConfigFleet(&conf)
|
||||
err := statusBackend.UpdateNodeConfigFleet(account, password, &conf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue