From 9ca891c7094d30db99b37cb64e638809bfe6aadd Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Tue, 22 Apr 2014 18:36:02 +0200 Subject: [PATCH] Wallet: restrict visibility of the transactions map a bit and tag the others as visible for testing. This should get fixed up in a future refactor. --- .../main/java/com/google/bitcoin/core/Wallet.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 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 af9c37a9..bb1ebf58 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -33,6 +33,7 @@ import com.google.bitcoin.utils.ListenerRegistration; import com.google.bitcoin.utils.Threading; import com.google.bitcoin.wallet.*; import com.google.bitcoin.wallet.WalletTransaction.Pool; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.*; import com.google.common.primitives.Ints; import com.google.common.util.concurrent.ListenableFuture; @@ -124,13 +125,13 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha // to the user in the UI, etc). A transaction can leave dead and move into spent/unspent if there is a // re-org to a chain that doesn't include the double spend. - final Map pending; - final Map unspent; - final Map spent; - final Map dead; + @VisibleForTesting final Map pending; + @VisibleForTesting final Map unspent; + @VisibleForTesting final Map spent; + @VisibleForTesting final Map dead; // All transactions together. - final Map transactions; + protected final Map transactions; // Transactions that were dropped by the risk analysis system. These are not in any pools and not serialized // to disk. We have to keep them around because if we ignore a tx because we think it will never confirm, but @@ -153,7 +154,7 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha // A list of scripts watched by this wallet. private Set