fix: nodeconfig unmarshaling (#2488)

This commit is contained in:
Richard Ramos 2022-01-13 13:31:08 -04:00 committed by GitHub
parent fd3bcbf8a1
commit 53f86fe2f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -1 +1 @@
0.93.0
0.93.1

View File

@ -313,7 +313,16 @@ func (db *Database) SaveSetting(setting string, value interface{}) error {
value = &sqlite.JSONBlob{Data: value}
update, err = db.db.Prepare("UPDATE settings SET networks = ? WHERE synthetic_id = 'id'")
case "node-config":
nodeConfig := value.(params.NodeConfig)
var jsonString []byte
jsonString, err = json.Marshal(value)
if err != nil {
return err
}
var nodeConfig params.NodeConfig
err = json.Unmarshal(jsonString, &nodeConfig)
if err != nil {
return err
}
if err = nodecfg.SaveNodeConfig(db.db, &nodeConfig); err != nil {
return err
}