I struggle using the timebounds option for an operation.
Use case : I want a transaction to be executed at a precise time, not before, not after.
I'm doing my tests on the test network. The transaction occured when I don't set a timeBounds, but when I do I get the same result without (except that my tokens aren't sent).
Here's the code I use :
String timeBounds = "1534239756";
TimeBounds timeBoundsT = new TimeBounds(Long.parseLong(timeBounds), 0);
transaction = new Transaction.Builder(sourceAccount)
.addOperation(new PaymentOperation.Builder(destination,
new AssetTypeCreditAlphaNum12(assetName, issuer), amount).build())
.addTimeBounds(timeBoundsT).addMemo(Memo.text("Memo")).build();
// Sign the transaction to prove you are actually the person sending it.
transaction.sign(distributor);
// And finally, send it off to Stellar!
SubmitTransactionResponse response = null;
try {
response = server.submitTransaction(transaction);
System.out.println("Success!");
System.out.println(response);
} catch (Exception e) {
System.out.println("Something went wrong!");
System.out.println(e.getMessage());
}
Here's my response :
Success!
org.stellar.sdk.responses.SubmitTransactionResponse@3deb2326
Any idea?