mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-19 05:33:44 +01:00
WalletTool: separate try block for setup/peerGroup.start in send()
This makes it more clear which operations throw `BlockStoreException` and which throw `ExecutionException` or `InterruptedException`.
This commit is contained in:
parent
1e088596df
commit
04ff5335cf
@ -727,6 +727,11 @@ public class WalletTool implements Callable<Integer> {
|
||||
try {
|
||||
setup();
|
||||
peerGroup.start();
|
||||
} catch (BlockStoreException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
// 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.
|
||||
@ -735,7 +740,7 @@ public class WalletTool implements Callable<Integer> {
|
||||
List<Peer> peerList = peerGroup.getConnectedPeers();
|
||||
if (peerList.size() == 1)
|
||||
peerList.get(0).sendPing().get();
|
||||
} catch (BlockStoreException | ExecutionException | InterruptedException e) {
|
||||
} catch (ExecutionException | InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user