Correct maven instruction in the README file and make ForwardingService work on mainnet again by fixing command line arg parsing.

Resolves issue 523.
This commit is contained in:
Mike Hearn
2014-03-10 17:36:32 +01:00
parent 8229daf38d
commit 829656b153
2 changed files with 8 additions and 5 deletions

View File

@@ -43,7 +43,7 @@ public class ForwardingService {
public static void main(String[] args) throws Exception {
// This line makes the log output more compact and easily read, especially when using the JDK log adapter.
BriefLogFormatter.init();
if (args.length < 2) {
if (args.length < 1) {
System.err.println("Usage: address-to-send-back-to [regtest|testnet]");
return;
}
@@ -51,10 +51,10 @@ public class ForwardingService {
// Figure out which network we should connect to. Each one gets its own set of files.
NetworkParameters params;
String filePrefix;
if (args[1].equals("testnet")) {
if (args.length > 1 && args[1].equals("testnet")) {
params = TestNet3Params.get();
filePrefix = "forwarding-service-testnet";
} else if (args[1].equals("regtest")) {
} else if (args.length > 1 && args[1].equals("regtest")) {
params = RegTestParams.get();
filePrefix = "forwarding-service-regtest";
} else {