WalletTool: Tighten two try blocks when sending.
@@ -619,7 +619,6 @@ public class WalletTool implements Callable<Integer> {
}
private void send(List<String> outputs, Coin feePerVkb, String lockTimeStr, boolean allowUnconfirmed) throws VerificationException {
- try {
// Convert the input strings to outputs.
Transaction t = new Transaction(params);
for (String spec : outputs) {
@@ -659,6 +658,8 @@ public class WalletTool implements Callable<Integer> {
if (req.aesKey == null)
return; // Error message already printed.
}
+
+ try {
wallet.completeTx(req);
try {
@@ -800,7 +801,6 @@ public class WalletTool implements Callable<Integer> {
}
private void send(PaymentSession session) {
- try {
System.out.println("Payment Request");
System.out.println("Coin: " + session.getValue().toFriendlyString());
System.out.println("Date: " + session.getDate());
@@ -815,6 +815,8 @@ public class WalletTool implements Callable<Integer> {
if (req.aesKey == null)
return; // Error message already printed.
}
+
+ try {
wallet.completeTx(req); // may throw InsufficientMoneyException.
if (offline) {
wallet.commitTx(req.tx);
