Cancel transaction approve by the clone transaction.

This commit is contained in:
Roman Mandeleil 2015-02-04 15:14:15 +02:00
parent a232df1998
commit 8985f6374a
1 changed files with 3 additions and 11 deletions

View File

@ -18,7 +18,7 @@ import static java.lang.Thread.sleep;
*/
public class TransactionTask implements Callable<Transaction> {
private static final Logger logger = LoggerFactory.getLogger(TransactionTask.class);
private static final Logger logger = LoggerFactory.getLogger("net");
private final Transaction tx;
private final WorldManager worldManager;
@ -32,21 +32,13 @@ public class TransactionTask implements Callable<Transaction> {
public Transaction call() throws Exception {
try {
logger.info("Call() tx: {}", tx.toString());
Wallet wallet = worldManager.getWallet();
logger.info("submit tx: {}", tx.toString());
ChannelManager channelManager = worldManager.getChannelManager();
WalletTransaction walletTransaction = wallet.addByWalletTransaction(tx);
channelManager.sendTransaction(tx);
return tx;
while (walletTransaction.getApproved() < 1) {
sleep(10);
}
logger.info("return approved: {}", walletTransaction.getApproved());
} catch (Throwable th) {
logger.warn("Exception caught: {}", th);
worldManager.getWallet().removeTransaction(tx);
}
return null;
}