mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-11-23 13:17:42 -05:00
Add null check for PayoutTx at startup
This commit is contained in:
parent
8eea1fab41
commit
9869b64352
4 changed files with 8 additions and 4 deletions
|
|
@ -54,7 +54,8 @@ public class BuyerAsOffererProtocol extends TradeProtocol implements BuyerProtoc
|
||||||
|
|
||||||
// If we are after the time lock state we need to setup the listener again
|
// If we are after the time lock state we need to setup the listener again
|
||||||
Trade.State tradeState = trade.getState();
|
Trade.State tradeState = trade.getState();
|
||||||
if ((tradeState.getPhase() == Trade.Phase.FIAT_RECEIVED || tradeState.getPhase() == Trade.Phase.PAYOUT_PAID) && tradeState != Trade.State.PAYOUT_BROAD_CASTED) {
|
Trade.Phase phase = tradeState.getPhase();
|
||||||
|
if (trade.getPayoutTx() != null && (phase == Trade.Phase.FIAT_RECEIVED || phase == Trade.Phase.PAYOUT_PAID) && tradeState != Trade.State.PAYOUT_BROAD_CASTED) {
|
||||||
|
|
||||||
TradeTaskRunner taskRunner = new TradeTaskRunner(trade,
|
TradeTaskRunner taskRunner = new TradeTaskRunner(trade,
|
||||||
() -> {
|
() -> {
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,8 @@ public class BuyerAsTakerProtocol extends TradeProtocol implements BuyerProtocol
|
||||||
|
|
||||||
// If we are after the timeLock state we need to setup the listener again
|
// If we are after the timeLock state we need to setup the listener again
|
||||||
Trade.State tradeState = trade.getState();
|
Trade.State tradeState = trade.getState();
|
||||||
if ((tradeState.getPhase() == Trade.Phase.FIAT_RECEIVED || tradeState.getPhase() == Trade.Phase.PAYOUT_PAID) && tradeState != Trade.State.PAYOUT_BROAD_CASTED) {
|
Trade.Phase phase = tradeState.getPhase();
|
||||||
|
if (trade.getPayoutTx() != null && (phase == Trade.Phase.FIAT_RECEIVED || phase == Trade.Phase.PAYOUT_PAID) && tradeState != Trade.State.PAYOUT_BROAD_CASTED) {
|
||||||
TradeTaskRunner taskRunner = new TradeTaskRunner(trade,
|
TradeTaskRunner taskRunner = new TradeTaskRunner(trade,
|
||||||
() -> {
|
() -> {
|
||||||
handleTaskRunnerSuccess("SetupPayoutTxLockTimeReachedListener");
|
handleTaskRunnerSuccess("SetupPayoutTxLockTimeReachedListener");
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,8 @@ public class SellerAsOffererProtocol extends TradeProtocol implements SellerProt
|
||||||
// If we are after the time lock state we need to setup the listener again
|
// If we are after the time lock state we need to setup the listener again
|
||||||
//TODO not sure if that is not called already from the checkPayoutTxTimeLock at tradeProtocol
|
//TODO not sure if that is not called already from the checkPayoutTxTimeLock at tradeProtocol
|
||||||
Trade.State tradeState = trade.getState();
|
Trade.State tradeState = trade.getState();
|
||||||
if ((tradeState.getPhase() == Trade.Phase.FIAT_RECEIVED || tradeState.getPhase() == Trade.Phase.PAYOUT_PAID) && tradeState != Trade.State.PAYOUT_BROAD_CASTED) {
|
Trade.Phase phase = tradeState.getPhase();
|
||||||
|
if (trade.getPayoutTx() != null && (phase == Trade.Phase.FIAT_RECEIVED || phase == Trade.Phase.PAYOUT_PAID) && tradeState != Trade.State.PAYOUT_BROAD_CASTED) {
|
||||||
TradeTaskRunner taskRunner = new TradeTaskRunner(trade,
|
TradeTaskRunner taskRunner = new TradeTaskRunner(trade,
|
||||||
() -> {
|
() -> {
|
||||||
handleTaskRunnerSuccess("SetupPayoutTxLockTimeReachedListener");
|
handleTaskRunnerSuccess("SetupPayoutTxLockTimeReachedListener");
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,8 @@ public class SellerAsTakerProtocol extends TradeProtocol implements SellerProtoc
|
||||||
// If we are after the timeLock state we need to setup the listener again
|
// If we are after the timeLock state we need to setup the listener again
|
||||||
//TODO not sure if that is not called already from the checkPayoutTxTimeLock at tradeProtocol
|
//TODO not sure if that is not called already from the checkPayoutTxTimeLock at tradeProtocol
|
||||||
Trade.State tradeState = trade.getState();
|
Trade.State tradeState = trade.getState();
|
||||||
if ((tradeState.getPhase() == Trade.Phase.FIAT_RECEIVED || tradeState.getPhase() == Trade.Phase.PAYOUT_PAID) && tradeState != Trade.State.PAYOUT_BROAD_CASTED) {
|
Trade.Phase phase = tradeState.getPhase();
|
||||||
|
if (trade.getPayoutTx() != null && (phase == Trade.Phase.FIAT_RECEIVED || phase == Trade.Phase.PAYOUT_PAID) && tradeState != Trade.State.PAYOUT_BROAD_CASTED) {
|
||||||
TradeTaskRunner taskRunner = new TradeTaskRunner(trade,
|
TradeTaskRunner taskRunner = new TradeTaskRunner(trade,
|
||||||
() -> {
|
() -> {
|
||||||
handleTaskRunnerSuccess("SetupPayoutTxLockTimeReachedListener");
|
handleTaskRunnerSuccess("SetupPayoutTxLockTimeReachedListener");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue