How to check if work has been done?

there is no way to check if the previous block has checked the method workable and returns true.

With while demo code, I have got 6 tx who failed because I am calling 6 times because workable return true.

1 Like

Hi @Bolo,

If I understand correctly, there was work to be done, the script then created a transaction, and repeated this 6 times. So need to get the first transaction mined faster (so subsequent checks show that there isn’t work to be done) and have a way to flag in the script that a transaction has been sent (so subsequent checks show that we have attempted to do work).

how do you suggest to do that?

1 Like

Coming up in Defender will be the option to set a fixed gasPrice and a validUntil timestamp for your Relayer transactions which should help with this.

You may also want to modify your script so that you flag (e.g. set a variable) if you have already sent a transaction to do the work so you don't send another transaction for that same work.

You may also want to modify your script so that you flag (e.g. set a variable) if you have already sent a transaction to do the work so you don’t send another transaction for that same work.

I did that with a hash

1 Like

Hi @Bolo,

These were added last week: Defender Release 2020W50: Webhook Support, Fixed Gas Price & Valid Until

1 Like