Make sure the blockchain is synced before running any data publishing code.

This commit is contained in:
CalDescent 2021-12-18 16:07:29 +00:00
parent 2d2b2964a5
commit 0afb1a2d04

View File

@ -855,6 +855,10 @@ public class ArbitraryResource {
throw ApiExceptionFactory.INSTANCE.createCustomException(request, ApiError.INVALID_CRITERIA, error);
}
if (!Controller.getInstance().isUpToDate()) {
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.BLOCKCHAIN_NEEDS_SYNC);
}
AccountData accountData = repository.getAccountRepository().getAccount(nameData.getOwner());
if (accountData == null) {
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.ADDRESS_UNKNOWN);