aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-tx.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2015-10-20 16:59:33 +0200
committerWladimir J. van der Laan <[email protected]>2015-10-20 17:06:28 +0200
commite26a3f6713f8f12640cdb75aad48676e901e0c75 (patch)
treed661b5d59dc32e59570910adf494155c4093faf6 /src/bitcoin-tx.cpp
parentMerge pull request #6841 (diff)
parentChainparams: Translations: DRY: options and error strings (diff)
downloaddiscoin-e26a3f6713f8f12640cdb75aad48676e901e0c75.tar.xz
discoin-e26a3f6713f8f12640cdb75aad48676e901e0c75.zip
Merge pull request #6235
55a8975 Chainparams: Translations: DRY: options and error strings (Jorge Timón) f3525e2 Chainparams: Replace CBaseChainParams::Network enum with string constants (suggested by Wladimir) (Jorge Timón)
Diffstat (limited to 'src/bitcoin-tx.cpp')
-rw-r--r--src/bitcoin-tx.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
index f7518fab5..5630d20cc 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -35,8 +35,10 @@ static bool AppInitRawTx(int argc, char* argv[])
ParseParameters(argc, argv);
// 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;
}
@@ -58,8 +60,7 @@ static bool AppInitRawTx(int argc, char* argv[])
strUsage += HelpMessageOpt("-create", _("Create new, empty TX."));
strUsage += HelpMessageOpt("-json", _("Select JSON output"));
strUsage += HelpMessageOpt("-txid", _("Output only the hex-encoded transaction id of the resultant transaction."));
- strUsage += HelpMessageOpt("-regtest", _("Enter regression test mode, which uses a special chain in which blocks can be solved instantly."));
- strUsage += HelpMessageOpt("-testnet", _("Use the test network"));
+ AppendParamsHelpMessages(strUsage);
fprintf(stdout, "%s", strUsage.c_str());