From 8985f6374a0069d4388a912de18169c946b23f8d Mon Sep 17 00:00:00 2001 From: Roman Mandeleil Date: Wed, 4 Feb 2015 15:14:15 +0200 Subject: [PATCH] Cancel transaction approve by the clone transaction. --- .../org/ethereum/net/submit/TransactionTask.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/net/submit/TransactionTask.java b/ethereumj-core/src/main/java/org/ethereum/net/submit/TransactionTask.java index 5dea0279..0e91a7ff 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/submit/TransactionTask.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/submit/TransactionTask.java @@ -18,7 +18,7 @@ import static java.lang.Thread.sleep; */ public class TransactionTask implements Callable { - 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 { 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; }