Closed tavindev closed 2 months ago
Thanks for the follow up!
Good point. We could use while (Date.now() - startTime < timeout || (await this.connection.getBlockHeight()) <= lastValidBlockHeight)
instead, which would then only check the blockhash after the timeout
. Considering that a transaction times out after ~60-90s, getBlockHeight
would be called at most ~2 times. This way, only transactions near expiry time would have extra RPC calls. What do you think?
No worries @tavindev! Yeah, that OR condition would work a lot better since we still have the initial timeout. I'm all for it
Done!
Fixes #102 by throwing timeout error only if the current block height is greater than the
lastValidBlockHeight
returned bygetLatestBlockhash
used when creating the transaction.