From 1d75fcfdaecb7b4296a971bce9f8913193aa76e8 Mon Sep 17 00:00:00 2001 From: HenrikJannsen Date: Thu, 5 Jan 2023 10:42:59 -0500 Subject: [PATCH] Rename isDaoStateIsInSync to isDaoStateReadyAndInSync Add daoStateService.isParseBlockChainComplete() check Signed-off-by: HenrikJannsen --- core/src/main/java/bisq/core/dao/DaoFacade.java | 5 +++-- .../protocol/bisq_v1/tasks/CheckIfDaoStateIsInSync.java | 2 +- .../tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java | 4 +--- .../tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/bisq/core/dao/DaoFacade.java b/core/src/main/java/bisq/core/dao/DaoFacade.java index 51f6b94aa1..ce445c53af 100644 --- a/core/src/main/java/bisq/core/dao/DaoFacade.java +++ b/core/src/main/java/bisq/core/dao/DaoFacade.java @@ -814,8 +814,9 @@ public class DaoFacade implements DaoSetupService { return daoStateService.isParseBlockChainComplete(); } - public boolean isDaoStateIsInSync() { - return !daoStateMonitoringService.isInConflictWithSeedNode() && + public boolean isDaoStateReadyAndInSync() { + return daoStateService.isParseBlockChainComplete() && + !daoStateMonitoringService.isInConflictWithSeedNode() && !daoStateMonitoringService.isDaoStateBlockChainNotConnecting(); } } diff --git a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/CheckIfDaoStateIsInSync.java b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/CheckIfDaoStateIsInSync.java index e70e7e9cae..519c5b47a8 100644 --- a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/CheckIfDaoStateIsInSync.java +++ b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/CheckIfDaoStateIsInSync.java @@ -36,7 +36,7 @@ public class CheckIfDaoStateIsInSync extends TradeTask { try { runInterceptHook(); - checkArgument(processModel.getDaoFacade().isDaoStateIsInSync(), "DAO state is not in sync with seed nodes"); + checkArgument(processModel.getDaoFacade().isDaoStateReadyAndInSync(), "DAO state is not in sync with seed nodes"); } catch (Throwable t) { failed(t); } diff --git a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java index 66e8361d88..3bf644b1fd 100644 --- a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java +++ b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java @@ -75,7 +75,6 @@ public class BuyerVerifiesFinalDelayedPayoutTx extends TradeTask { lockTime); if (!buyersDelayedPayoutTx.getTxId().equals(finalDelayedPayoutTx.getTxId())) { - String errorMsg = "TxIds of buyersDelayedPayoutTx and finalDelayedPayoutTx must be the same."; log.error("{} \nbuyersDelayedPayoutTx={}, \nfinalDelayedPayoutTx={}, " + "\nBtcWalletService.chainHeight={}, " + @@ -84,8 +83,7 @@ public class BuyerVerifiesFinalDelayedPayoutTx extends TradeTask { errorMsg, buyersDelayedPayoutTx, finalDelayedPayoutTx, processModel.getBtcWalletService().getBestChainHeight(), processModel.getDaoFacade().getChainHeight(), - processModel.getDaoFacade().isDaoStateIsInSync()); - + processModel.getDaoFacade().isDaoStateReadyAndInSync()); throw new IllegalArgumentException(errorMsg); } } diff --git a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java index fe3e580086..6fe2321d07 100644 --- a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java +++ b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java @@ -74,7 +74,7 @@ public class BuyerVerifiesPreparedDelayedPayoutTx extends TradeTask { errorMsg, buyersPreparedDelayedPayoutTx, sellersPreparedDelayedPayoutTx, processModel.getBtcWalletService().getBestChainHeight(), processModel.getDaoFacade().getChainHeight(), - processModel.getDaoFacade().isDaoStateIsInSync()); + processModel.getDaoFacade().isDaoStateReadyAndInSync()); throw new IllegalArgumentException(errorMsg); } }