mirror of https://github.com/m2049r/xmrwallet.git
failsafe sending in mainnet
- die ungracefully with an exception because this should be possible anyway
This commit is contained in:
parent
30e35a895d
commit
4ad58684b4
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue