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:
parent
5f92e84c19
commit
07c6808385
|
@ -718,10 +718,7 @@ func (b *GethStatusBackend) saveNodeConfig(n *params.NodeConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *GethStatusBackend) GetNodeConfig() (*params.NodeConfig, error) {
|
func (b *GethStatusBackend) GetNodeConfig() (*params.NodeConfig, error) {
|
||||||
if b.config == nil {
|
return nodecfg.GetNodeConfigFromDB(b.appDB)
|
||||||
return nil, ErrConfigNotAvailable
|
|
||||||
}
|
|
||||||
return b.config, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *GethStatusBackend) startNode(config *params.NodeConfig) (err error) {
|
func (b *GethStatusBackend) startNode(config *params.NodeConfig) (err error) {
|
||||||
|
|
Loading…
Reference in New Issue