fix requesting block height + 1 on update trade period

This commit is contained in:
woodser 2025-11-04 09:14:52 -05:00 committed by woodser
parent 49178073e4
commit bcb46605ff

View file

@ -2635,7 +2635,7 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model {
// get finalize time of last deposit tx
if (getWallet() == null) throw new RuntimeException("Cannot set start time for trade " + getId() + " because cannot get its wallet");
Long finalizeHeight = getDepositsFinalizedHeight();
if (finalizeHeight == null || finalizeHeight > xmrConnectionService.getTargetHeight()) return; // TODO: isDepositsFinalized() can assume true, so skip if finalized height not reached
if (finalizeHeight == null || finalizeHeight > xmrConnectionService.getTargetHeight() - 1) return; // TODO: isDepositsFinalized() can assume true, so skip if finalized height not reached
long finalizeTime = monerod.getBlockByHeight(finalizeHeight).getTimestamp() * 1000;
// If block date is in future (Date in blocks can be off by +/- 2 hours) we use our current date.