Make `GetNodeConfig` retrieve config from DB

Prior to this commit, this API returns the in memory `NodeConfig` which
might not be the latest state.
This is the case when for example clients update any `NodeConfig` and
retrieve it right afterwards via `GetNodeConfig`.
To get the latest state of `NodeConfig` it has to be fetched from DB
instead.
This commit is contained in:
Pascal Precht 2022-05-03 16:47:56 +02:00 committed by r4bbit.eth
parent 5f92e84c19
commit 07c6808385
1 changed files with 1 additions and 4 deletions

View File

@ -718,10 +718,7 @@ func (b *GethStatusBackend) saveNodeConfig(n *params.NodeConfig) error {
}
func (b *GethStatusBackend) GetNodeConfig() (*params.NodeConfig, error) {
if b.config == nil {
return nil, ErrConfigNotAvailable
}
return b.config, nil
return nodecfg.GetNodeConfigFromDB(b.appDB)
}
func (b *GethStatusBackend) startNode(config *params.NodeConfig) (err error) {