Wallet: Make getPoolSize() visible for testing.

This commit is contained in:
Andreas Schildbach 2016-01-16 15:59:15 +01:00
parent f1e3a73e75
commit 91c4e080ad

View File

@ -2702,9 +2702,7 @@ public class Wallet extends BaseTaggableObject
try {
checkArgument(numTransactions >= 0);
// Firstly, put all transactions into an array.
int size = getPoolSize(Pool.UNSPENT) +
getPoolSize(Pool.SPENT) +
getPoolSize(Pool.PENDING);
int size = unspent.size() + spent.size() + pending.size();
if (numTransactions > size || numTransactions == 0) {
numTransactions = size;
}
@ -2900,7 +2898,8 @@ public class Wallet extends BaseTaggableObject
}
}
int getPoolSize(WalletTransaction.Pool pool) {
@VisibleForTesting
public int getPoolSize(WalletTransaction.Pool pool) {
lock.lock();
try {
switch (pool) {