diff --git a/README b/README index 13b2d9e3..63e004fc 100644 --- a/README +++ b/README @@ -11,10 +11,13 @@ find your unzipped Maven install directory. Now try running one of the example apps: cd examples - mvn exec:java -Dexec.mainClass=com.google.bitcoin.examples.ForwardingService + mvn exec:java -Dexec.mainClass=com.google.bitcoin.examples.ForwardingService -Dexec.args="" It will download the block chain and eventually print a Bitcoin address. If you send coins to it, -it will forward them on to the address you specified. +it will forward them on to the address you specified. Note that this example app does not use +checkpointing, so the initial chain sync will be pretty slow. You can make an app that starts up and +does the initial sync much faster by including a checkpoints file; see the documentation for +more info on this. Now you are ready to follow the tutorial: diff --git a/examples/src/main/java/com/google/bitcoin/examples/ForwardingService.java b/examples/src/main/java/com/google/bitcoin/examples/ForwardingService.java index 065b0f2c..8fadab7c 100644 --- a/examples/src/main/java/com/google/bitcoin/examples/ForwardingService.java +++ b/examples/src/main/java/com/google/bitcoin/examples/ForwardingService.java @@ -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 {