1

I have a condition like

let now = Clock::get()?.unix_timestamp as u64; if now <= account.start_time { // throw Error }

So if the user send the start time from the front end and then it compare the start time (account.start_time) to the cluster time (now). So there is always the 15 to 20 second difference of users start time and cluster time and it throw the error in a wrong condition. So How can I sync with as to remove this 15 to 20 second difference.

1 Answer 1

1

It is difficult to control two independent walltime sources like this. Instead of letting the user submit the start_time from the frontend, use a transaction to set it from the clock sysvar

1
  • Yes I can do this like, but actually I want to start the stream of some amount like of start time = 05:10:25 and according to the sysvar time I would set it like start time = 05:10:35, and then when I want to withdraw stream after 15 second so it might effect the stream amount because the cluster is changing some time ? How can I manage this ?
    – Aslam
    Commented Jul 23, 2022 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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