Cancel transaction approve by the clone transaction.
This commit is contained in:
parent
a232df1998
commit
8985f6374a
|
@ -18,7 +18,7 @@ import static java.lang.Thread.sleep;
|
||||||
*/
|
*/
|
||||||
public class TransactionTask implements Callable<Transaction> {
|
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 Transaction tx;
|
||||||
private final WorldManager worldManager;
|
private final WorldManager worldManager;
|
||||||
|
@ -32,21 +32,13 @@ public class TransactionTask implements Callable<Transaction> {
|
||||||
public Transaction call() throws Exception {
|
public Transaction call() throws Exception {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info("Call() tx: {}", tx.toString());
|
logger.info("submit tx: {}", tx.toString());
|
||||||
|
|
||||||
Wallet wallet = worldManager.getWallet();
|
|
||||||
ChannelManager channelManager = worldManager.getChannelManager();
|
ChannelManager channelManager = worldManager.getChannelManager();
|
||||||
|
|
||||||
WalletTransaction walletTransaction = wallet.addByWalletTransaction(tx);
|
|
||||||
channelManager.sendTransaction(tx);
|
channelManager.sendTransaction(tx);
|
||||||
|
return tx;
|
||||||
|
|
||||||
while (walletTransaction.getApproved() < 1) {
|
|
||||||
sleep(10);
|
|
||||||
}
|
|
||||||
logger.info("return approved: {}", walletTransaction.getApproved());
|
|
||||||
} catch (Throwable th) {
|
} catch (Throwable th) {
|
||||||
logger.warn("Exception caught: {}", th);
|
logger.warn("Exception caught: {}", th);
|
||||||
worldManager.getWallet().removeTransaction(tx);
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue