diff --git a/src/com/google/bitcoin/core/Block.java b/src/com/google/bitcoin/core/Block.java index 515f9d3a..9b779a2a 100644 --- a/src/com/google/bitcoin/core/Block.java +++ b/src/com/google/bitcoin/core/Block.java @@ -311,7 +311,7 @@ public class Block extends Message { // / \ / \ // 2 3 4 5 // / \ / \ / \ / \ - // t1 t2 t3 t4 t5 t5 t5 t5 + // t1 t2 t3 t4 t5 t5 t5 t5 ArrayList tree = new ArrayList(); // Start by adding all the hashes of the transactions as leaves of the tree. for (Transaction t : transactions) { diff --git a/src/com/google/bitcoin/examples/PingService.java b/src/com/google/bitcoin/examples/PingService.java index 5b9aa2ed..1374ead0 100644 --- a/src/com/google/bitcoin/examples/PingService.java +++ b/src/com/google/bitcoin/examples/PingService.java @@ -113,9 +113,13 @@ public class PingService { if (max > 0) { System.out.println("Downloading block chain. " + (max > 1000 ? "This may take a while." : "")); long current = max; + int lastPercent = 0; while (current > 0) { double pct = 100.0 - (100.0 * (current / (double) max)); - System.out.println(String.format("Chain download %d%% done", (int) pct)); + if ((int)pct != lastPercent) { + System.out.println(String.format("Chain download %d%% done", (int) pct)); + lastPercent = (int) pct; + } progress.await(1, TimeUnit.SECONDS); current = progress.getCount(); }