diff --git a/rai/rai_wallet/entry.cpp b/rai/rai_wallet/entry.cpp index ae9bd81b..cb8b4f9b 100644 --- a/rai/rai_wallet/entry.cpp +++ b/rai/rai_wallet/entry.cpp @@ -221,7 +221,18 @@ int run_wallet (int argc, char * const * argv) assert (false); } runner.join (); - error = config.serialize_json_stream (config_file); + config_file.seekg (0); + auto account (config.account); + if (!rai::fetch_object (config, config_file)) + { + if (account != config.account) + { + config.account = account; + config_file.close (); + config_file.open (config_path, std::ios_base::out | std::ios_base::trunc); + error = config.serialize_json_stream (config_file); + } + } } else {