Upgrade to Guava 16.0.1.

Resolves issue 375.
This commit is contained in:
Andreas Schildbach
2014-04-06 15:54:17 +02:00
committed by Mike Hearn
parent 9a54a7753d
commit 6087e43377
24 changed files with 210 additions and 82 deletions

View File

@@ -1,3 +1,20 @@
/*
* Copyright 2013 Google Inc.
* Copyright 2014 Andreas Schildbach
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.bitcoin.tools;
import com.google.bitcoin.core.*;
@@ -58,7 +75,8 @@ public class BuildCheckpoints {
}
}, Threading.SAME_THREAD);
peerGroup.startAndWait();
peerGroup.startAsync();
peerGroup.awaitRunning();
peerGroup.downloadBlockChain();
checkState(checkpoints.size() > 0);
@@ -85,7 +103,8 @@ public class BuildCheckpoints {
digestOutputStream.close();
fileOutputStream.close();
peerGroup.stopAndWait();
peerGroup.stopAsync();
peerGroup.awaitTerminated();
store.close();
// Sanity check the created file.

View File

@@ -1,5 +1,6 @@
/*
* Copyright 2012 Google Inc.
* Copyright 2014 Andreas Schildbach
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -452,7 +453,8 @@ public class WalletTool {
}
setup();
peers.startAndWait();
peers.startAsync();
peers.awaitRunning();
// Wait for peers to connect, the tx to be sent to one of them and for it to be propagated across the
// network. Once propagation is complete and we heard the transaction back from all our peers, it will
// be committed to the wallet.
@@ -557,7 +559,8 @@ public class WalletTool {
ListenableFuture<PaymentSession.Ack> future = session.sendPayment(ImmutableList.of(req.tx), null, null);
if (future == null) {
// No payment_url for submission so, broadcast and wait.
peers.startAndWait();
peers.startAsync();
peers.awaitRunning();
peers.broadcastTransaction(req.tx).get();
} else {
PaymentSession.Ack ack = future.get();
@@ -651,7 +654,7 @@ public class WalletTool {
break;
}
peers.start();
peers.startAsync();
try {
latch.await();
} catch (InterruptedException e) {
@@ -713,7 +716,8 @@ public class WalletTool {
setup();
int startTransactions = wallet.getTransactions(true).size();
DownloadListener listener = new DownloadListener();
peers.startAndWait();
peers.startAsync();
peers.awaitRunning();
peers.startBlockChainDownload(listener);
try {
listener.await();
@@ -734,7 +738,8 @@ public class WalletTool {
private static void shutdown() {
try {
if (peers == null) return; // setup() never called so nothing to do.
peers.stopAndWait();
peers.stopAsync();
peers.awaitTerminated();
saveWallet(walletFile);
store.close();
wallet = null;

View File

@@ -1,3 +1,20 @@
/*
* Copyright 2013 Google Inc.
* Copyright 2014 Andreas Schildbach
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.bitcoin.tools;
import com.google.bitcoin.core.*;
@@ -27,6 +44,6 @@ public class WatchMempool {
}
}
});
peerGroup.start();
peerGroup.startAsync();
}
}