Chainparams: Translations: DRY: options and error strings

Also remove SelectBaseParamsFromCommandLine and SelectParamsFromCommandLine
This commit is contained in:
Jorge Timón
2015-05-25 09:00:17 +02:00
parent f3525e24e3
commit 55a89751fa
9 changed files with 37 additions and 51 deletions

View File

@@ -102,8 +102,10 @@ bool AppInit(int argc, char* argv[])
return false;
}
// Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
if (!SelectParamsFromCommandLine()) {
fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n");
try {
SelectParams(ChainNameFromCommandLine());
} catch(std::exception &e) {
fprintf(stderr, "Error: %s\n", e.what());
return false;
}