fetch deposit txs unless cached and confirmed

This commit is contained in:
woodser 2023-01-23 16:30:58 -05:00
parent 23393bb4b8
commit 882f1c070a

View file

@ -866,7 +866,7 @@ public abstract class Trade implements Tradable, Model {
public MoneroTx getTakerDepositTx() { public MoneroTx getTakerDepositTx() {
String depositTxHash = getProcessModel().getTaker().getDepositTxHash(); String depositTxHash = getProcessModel().getTaker().getDepositTxHash();
try { try {
if (getTaker().getDepositTx() == null) getTaker().setDepositTx(depositTxHash == null ? null : getXmrWalletService().getTxWithCache(depositTxHash)); if (getTaker().getDepositTx() == null || !getTaker().getDepositTx().isConfirmed()) getTaker().setDepositTx(depositTxHash == null ? null : getXmrWalletService().getTxWithCache(depositTxHash));
return getTaker().getDepositTx(); return getTaker().getDepositTx();
} catch (MoneroError e) { } catch (MoneroError e) {
log.error("Wallet is missing taker deposit tx " + depositTxHash); log.error("Wallet is missing taker deposit tx " + depositTxHash);
@ -878,7 +878,7 @@ public abstract class Trade implements Tradable, Model {
public MoneroTx getMakerDepositTx() { public MoneroTx getMakerDepositTx() {
String depositTxHash = getProcessModel().getMaker().getDepositTxHash(); String depositTxHash = getProcessModel().getMaker().getDepositTxHash();
try { try {
if (getMaker().getDepositTx() == null) getMaker().setDepositTx(depositTxHash == null ? null : getXmrWalletService().getTxWithCache(depositTxHash)); if (getMaker().getDepositTx() == null || !getMaker().getDepositTx().isConfirmed()) getMaker().setDepositTx(depositTxHash == null ? null : getXmrWalletService().getTxWithCache(depositTxHash));
return getMaker().getDepositTx(); return getMaker().getDepositTx();
} catch (MoneroError e) { } catch (MoneroError e) {
log.error("Wallet is missing maker deposit tx " + depositTxHash); log.error("Wallet is missing maker deposit tx " + depositTxHash);