Address some review comments from Miron.

This commit is contained in:
Mike Hearn
2012-01-09 15:42:43 +01:00
committed by Miron Cuperman
parent 35ec0b669d
commit 32f41dc1a9

View File

@@ -793,7 +793,8 @@ public class Wallet implements Serializable {
* @throws IOException if there was a problem broadcasting the transaction
*/
public synchronized Transaction sendCoins(PeerGroup peerGroup, Address to, BigInteger nanocoins) throws IOException {
Transaction tx = createSend(to, nanocoins);
Transaction tx = sendCoinsOffline(to, nanocoins);
if (tx == null) // Not enough money! :-(
return null;
try {
@@ -801,6 +802,7 @@ public class Wallet implements Serializable {
} catch (VerificationException e) {
throw new RuntimeException(e); // Cannot happen unless there's a bug, as we just created this ourselves.
}
if (!peerGroup.broadcastTransaction(tx)) {
throw new IOException("Failed to broadcast tx to all connected peers");
}