|
|
|
|
@ -42,11 +42,16 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (!cfg.load()) { |
|
|
|
|
qCritical("Failed to load config: %s", qPrintable(cfgPath)); |
|
|
|
|
qCritical("Cannot open/read config file: %s", qPrintable(cfgPath)); |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
if (cfg.privKey().length() != 64 || cfg.pubKey().length() != 64 || |
|
|
|
|
cfg.nodeId().length() != 16) { |
|
|
|
|
if (cfg.privKey().length() != 64 || cfg.pubKey().length() != 64) { |
|
|
|
|
qWarning("Config: keys missing/invalid, regenerating identity"); |
|
|
|
|
cfg.generateIdentity(); |
|
|
|
|
needSave = true; |
|
|
|
|
} |
|
|
|
|
if (cfg.nodeId().length() != 16) { |
|
|
|
|
qWarning("Config: my_node_id missing/invalid, regenerating identity"); |
|
|
|
|
cfg.generateIdentity(); |
|
|
|
|
needSave = true; |
|
|
|
|
} |
|
|
|
|
|