mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-19 05:33:44 +01:00
Wallet: Make getPoolSize() visible for testing.
This commit is contained in:
parent
f1e3a73e75
commit
91c4e080ad
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user