From c400a7c7566114f0ea8d74236e39a968e259cc4e Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Fri, 6 Apr 2012 13:39:41 +0200 Subject: [PATCH] Peer.java: change trace to info on receiving a block Wallet.java: print more info to logs if wallet sizes are inconsistent --- core/src/main/java/com/google/bitcoin/core/Peer.java | 2 +- core/src/main/java/com/google/bitcoin/core/Wallet.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/core/Peer.java b/core/src/main/java/com/google/bitcoin/core/Peer.java index 271dc7fbb..75500afe1 100644 --- a/core/src/main/java/com/google/bitcoin/core/Peer.java +++ b/core/src/main/java/com/google/bitcoin/core/Peer.java @@ -315,7 +315,7 @@ public class Peer { } private void processBlock(Block m) throws IOException { - log.trace("Received broadcast block {}", m.getHashAsString()); + log.info("Received broadcast block {}", m.getHashAsString()); try { // Was this block requested by getBlock()? synchronized (pendingGetBlockFutures) { diff --git a/core/src/main/java/com/google/bitcoin/core/Wallet.java b/core/src/main/java/com/google/bitcoin/core/Wallet.java index fcc72e22f..ed73623ac 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -213,8 +213,12 @@ public class Wallet implements Serializable { pendingInactive.addAll(pending.values()); pendingInactive.addAll(inactive.values()); - return getTransactions(true, true).size() == - unspent.size() + spent.size() + pendingInactive.size() + dead.size(); + int size1 = getTransactions(true, true).size(); + int size2 = unspent.size() + spent.size() + pendingInactive.size() + dead.size(); + if (size1 != size2) { + log.error("Inconsistent wallet sizes: {} {}", size1, size2); + } + return size1 == size2; } /**