failsafe sending in mainnet

- die ungracefully with an exception because this should be possible anyway
This commit is contained in:
m2049r 2017-08-20 16:55:59 +02:00
parent 30e35a895d
commit 4ad58684b4
1 changed files with 5 additions and 0 deletions

View File

@ -319,10 +319,15 @@ public class WalletService extends Service {
} else if (cmd.equals(REQUEST_CMD_SEND)) {
Wallet myWallet = getWallet();
Log.d(TAG, "SEND TX for wallet: " + myWallet.getName());
if (!myWallet.isTestNet()) {
Log.e(TAG, "Sending transactions only on testnet");
throw new IllegalStateException("Sending transactions only in testnet");
}
PendingTransaction pendingTransaction = myWallet.getPendingTransaction();
if (pendingTransaction.getStatus() != PendingTransaction.Status.Status_Ok) {
Log.e(TAG, "PendingTransaction is " + pendingTransaction.getStatus());
myWallet.disposePendingTransaction(); // it's broken anyway
if (observer != null) observer.onSentTransaction(false);
return;
}
String txid = pendingTransaction.getFirstTxId();