3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 02:35:52 +00:00

Rename Wallet.waitForBalance() to be Wallet.getBalanceFuture().

This commit is contained in:
Mike Hearn 2013-05-06 12:00:39 +02:00
parent e8f1418865
commit 82e056cab7
2 changed files with 3 additions and 3 deletions

View File

@ -2813,7 +2813,7 @@ public class Wallet implements Serializable, BlockChainListener {
* If the wallet already has a large enough balance the future is returned in a pre-completed state. Note that this
* method is not blocking, if you want to <i>actually</i> wait immediately, you have to call .get() on the result.
*/
public ListenableFuture<BigInteger> waitForBalance(final BigInteger value, final BalanceType type) {
public ListenableFuture<BigInteger> getBalanceFuture(final BigInteger value, final BalanceType type) {
final SettableFuture<BigInteger> future = SettableFuture.create();
final BigInteger current = getBalance(type);
if (current.compareTo(value) >= 0) {

View File

@ -176,8 +176,8 @@ public class WalletTest extends TestWithWallet {
private void receiveAPendingTransaction(Wallet wallet, Address toAddress) throws Exception {
BigInteger v1 = Utils.toNanoCoins(1, 0);
final ListenableFuture<BigInteger> availFuture = wallet.waitForBalance(v1, Wallet.BalanceType.AVAILABLE);
final ListenableFuture<BigInteger> estimatedFuture = wallet.waitForBalance(v1, Wallet.BalanceType.ESTIMATED);
final ListenableFuture<BigInteger> availFuture = wallet.getBalanceFuture(v1, Wallet.BalanceType.AVAILABLE);
final ListenableFuture<BigInteger> estimatedFuture = wallet.getBalanceFuture(v1, Wallet.BalanceType.ESTIMATED);
assertFalse(availFuture.isDone());
assertFalse(estimatedFuture.isDone());
Transaction t1 = sendMoneyToWallet(wallet, v1, toAddress, null);