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:
Sean Gilligan 2023-03-31 09:43:57 -07:00 committed by Andreas Schildbach
parent 1e088596df
commit 04ff5335cf

View File

@ -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);
}
}