6

I'm trying to add a simple time bounds with the Java SDK to settle a transaction happening at a certain time.

Code used :

Instant unlockDate = Instant.now().plusSeconds(60 * 2);
    TimeBounds timeBounds = new TimeBounds(unlockDate.getEpochSecond(), 0);
Transaction transaction = new Transaction.Builder(sourceAccount)
      .addOperation(new PaymentOperation.Builder(destination,
          new AssetTypeCreditAlphaNum12("xxx", issuer), amount).build())
      .addTimeBounds(timeBounds)
      .addMemo(Memo.text("Memo")).build();
  transaction.sign(distributor);

But I get this error :

Exception in thread "main" java.lang.IllegalArgumentException: minTime must be >= maxTime

It seems you can't set the maxTime to 0 anymore.

Is there a workaround?

6

Thanks for catching this. It's a bug in Java SDK, please upgrade to 0.3.1 and it should be fixed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.