mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Merge pull request #5797 from jmacxx/fix_exception_opening_mediation
Prevent NPE in case delayedPayoutTx is not present (failed trade)
This commit is contained in:
commit
851bdcf9ff
@ -495,7 +495,8 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
|||||||
}
|
}
|
||||||
Trade.DisputeState disputeState = trade.getDisputeState();
|
Trade.DisputeState disputeState = trade.getDisputeState();
|
||||||
DisputeManager<? extends DisputeList<Dispute>> disputeManager;
|
DisputeManager<? extends DisputeList<Dispute>> disputeManager;
|
||||||
long remainingLockTime = trade.getDelayedPayoutTx().getLockTime() - btcWalletService.getBestChainHeight();
|
long lockTime = trade.getDelayedPayoutTx() == null ? trade.getLockTime() : trade.getDelayedPayoutTx().getLockTime();
|
||||||
|
long remainingLockTime = lockTime - btcWalletService.getBestChainHeight();
|
||||||
// In case we re-open a dispute we allow Trade.DisputeState.MEDIATION_REQUESTED
|
// In case we re-open a dispute we allow Trade.DisputeState.MEDIATION_REQUESTED
|
||||||
boolean useMediation = disputeState == Trade.DisputeState.NO_DISPUTE ||
|
boolean useMediation = disputeState == Trade.DisputeState.NO_DISPUTE ||
|
||||||
(disputeState == Trade.DisputeState.MEDIATION_REQUESTED && remainingLockTime > 0);
|
(disputeState == Trade.DisputeState.MEDIATION_REQUESTED && remainingLockTime > 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user