Browse Source

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

qdn
CalDescent 3 years ago
parent
commit
0afb1a2d04
  1. 4
      src/main/java/org/qortal/api/resource/ArbitraryResource.java

4
src/main/java/org/qortal/api/resource/ArbitraryResource.java

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

Loading…
Cancel
Save