Source:
<code>private void initPendingTrades() { List<Trade> addTradeToFailedTradesList = new ArrayList<>(); List<Trade> removePreparedTradeList = new ArrayList<>(); tradesForStatistics = new ArrayList<>(); tradableList.forEach(trade -> { if (trade.isDepositPublished() || (trade.isTakerFeePublished() && !trade.hasFailed())) { initTrade(trade, trade.getProcessModel().isUseSavingsWallet(), trade.getProcessModel().getFundsNeededForTradeAsLong()); trade.updateDepositTxFromWallet(); tradesForStatistics.add(trade); } else if (trade.isTakerFeePublished() && !trade.isFundsLockedIn()) { addTradeToFailedTradesList.add(trade); trade.appendErrorMessage("Invalid state: trade.isTakerFeePublished() && !trade.isFundsLockedIn()"); } else { removePreparedTradeList.add(trade); } if (trade.getDepositTx() == null) { log.warn("Deposit tx for trader with ID is null at initPendingTrades. " + "This can happen for valid transaction in rare cases (e.g. after a SPV resync). " + "We leave it to the user to move the trade to failed trades if the problem persists.", trade.getId()); tradesWithoutDepositTx.add(trade); } try { <START> DonationAddressValidation.validate(trade.getDelayedPayoutTx(), daoFacade, btcWalletService); <END> } catch (DonationAddressValidation.DonationAddressException e) { addTradeToFailedTradesList.add(trade); } } ); closedTradableManager.getClosedTradables().stream() .filter(tradable -> tradable instanceof Trade) .map(tradable -> (Trade) tradable) .filter(Trade::isFundsLockedIn) .forEach(addTradeToFailedTradesList::add); addTradeToFailedTradesList.forEach(closedTradableManager::remove); addTradeToFailedTradesList.forEach(this::addTradeToFailedTrades); removePreparedTradeList.forEach(this::removePreparedTrade); cleanUpAddressEntries(); pendingTradesInitialized.set(true); }</code><technical_language>Regtest. get if test this PR. create a trade a delayedPayoutTx</technical_language>

Target:
private void initPendingTrades() { List<Trade> addTradeToFailedTradesList = new ArrayList<>(); List<Trade> removePreparedTradeList = new ArrayList<>(); tradesForStatistics = new ArrayList<>(); tradableList.forEach(trade -> { if (trade.isDepositPublished() || (trade.isTakerFeePublished() && !trade.hasFailed())) { initTrade(trade, trade.getProcessModel().isUseSavingsWallet(), trade.getProcessModel().getFundsNeededForTradeAsLong()); trade.updateDepositTxFromWallet(); tradesForStatistics.add(trade); } else if (trade.isTakerFeePublished() && !trade.isFundsLockedIn()) { addTradeToFailedTradesList.add(trade); trade.appendErrorMessage("Invalid state: trade.isTakerFeePublished() && !trade.isFundsLockedIn()"); } else { removePreparedTradeList.add(trade); } if (trade.getDepositTx() == null) { log.warn("Deposit tx for trader with ID is null at initPendingTrades. " + "This can happen for valid transaction in rare cases (e.g. after a SPV resync). " + "We leave it to the user to move the trade to failed trades if the problem persists.", trade.getId()); tradesWithoutDepositTx.add(trade); } try { DonationAddressValidation.validate(trade.getDelayedPayoutTx(), daoFacade, btcWalletService); } catch (DonationAddressValidation.DonationAddressException | DonationAddressValidation.MissingDelayedPayoutTxException e) { addTradeToFailedTradesList.add(trade); } } ); closedTradableManager.getClosedTradables().stream() .filter(tradable -> tradable instanceof Trade) .map(tradable -> (Trade) tradable) .filter(Trade::isFundsLockedIn) .forEach(addTradeToFailedTradesList::add); addTradeToFailedTradesList.forEach(closedTradableManager::remove); addTradeToFailedTradesList.forEach(this::addTradeToFailedTrades); removePreparedTradeList.forEach(this::removePreparedTrade); cleanUpAddressEntries(); pendingTradesInitialized.set(true); }