Rename isDaoStateIsInSync to isDaoStateReadyAndInSync

Add daoStateService.isParseBlockChainComplete() check

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2023-01-05 10:42:59 -05:00 committed by Alejandro García
parent f99d2f00ce
commit 1d75fcfdae
No known key found for this signature in database
GPG Key ID: F806F422E222AA02
4 changed files with 6 additions and 7 deletions

View File

@ -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();
}
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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);
}
}