From 5b78601b4ab9edd3ceeb9328be320d22289a1c19 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Wed, 10 Jul 2013 15:32:36 +0200 Subject: [PATCH] Wallet: make last seen block height default to zero not -1 --- core/src/main/java/com/google/bitcoin/core/Wallet.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 1e2bb0aa..f711006f 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -115,7 +115,7 @@ public class Wallet implements Serializable, BlockChainListener { private final NetworkParameters params; private Sha256Hash lastBlockSeenHash; - private int lastBlockSeenHeight = -1; + private int lastBlockSeenHeight; private transient CopyOnWriteArrayList> eventListeners; @@ -2571,7 +2571,10 @@ public class Wallet implements Serializable, BlockChainListener { } } - /** Returns the height of the last seen best-chain block. Can be -1 if a wallet is old and doesn't have that data. */ + /** + * Returns the height of the last seen best-chain block. Can be 0 if a wallet is brand new or -1 if the wallet + * is old and doesn't have that data. + */ public int getLastBlockSeenHeight() { lock.lock(); try {