Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait for confirmation could run into infinite loop #26

Closed
BrelKsiba opened this issue Feb 2, 2022 · 3 comments
Closed

wait for confirmation could run into infinite loop #26

BrelKsiba opened this issue Feb 2, 2022 · 3 comments

Comments

@BrelKsiba
Copy link

BrelKsiba commented Feb 2, 2022

It could happen that the function wait_for_confirmation(client, txid) is running/waiting undefinitely. This happens some times for a reason that I cannot explain.

Do you know in which case this situation can happen?

A suggestion could be to define the wait_for_confirmation and submit functions with an additional timeout parameter, for example:

def wait_for_confirmation(client, txid, timeout)

and/or

def submit(transaction_group, wait, timeout): ---> when wait = True, a timeout could be given.

@gokselcoban
Copy link
Contributor

Hi @BrelKsiba,

wait_for_confirmation is added to py-algorand-sdk too (see). It has the feature you have requested with a default value of 1000 blocks which is the maximum range (first valid - last valid). So you can start to use it think.

I think it can be removed from the tinyman-py-sdk, or keep it an alias.

@gokselcoban
Copy link
Contributor

Do you know in which case this situation can happen?

Probably it happens if your transaction is not approved by the protocol.
For example, if the price changes more than the given slippage, your transaction fails.

@BrelKsiba
Copy link
Author

Thx.
Using wait_for_confirmation from py-algorand-sdk fixed the problem. Still need to modify the submit function in Tinyman SDK to add a third parametr for wait_rounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants