Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Improve send_transfer to retry in case of server error #153

Open
maeck70 opened this issue Feb 8, 2018 · 1 comment
Open

Improve send_transfer to retry in case of server error #153

maeck70 opened this issue Feb 8, 2018 · 1 comment

Comments

@maeck70
Copy link
Contributor

maeck70 commented Feb 8, 2018

In very rare cases I am getting iota.adapter.BadApiResponse: 400 response from node: inconsistent tips pair selected when using send_transfer(). It is not something that is in my control, the only thing I can do is resubmit the transfer (pro-tip change the depth a little).

In my opinion send_transfer should have a default 'max_retries=5' parameter that the user can override.
The send_transfer would reissue the transaction in case of a server error (up to max_retries times).
If the response is 'inconsistent tips, the transaction reissue could increase 'depth' by 1 for each retry to avoid the tips inconsistency.

Note that Phx has opened iotaledger/iri#532 with the IRI folks to make sure the error is a 500 response, not a 400 response.

Note that I cannot recreate the 'inconsistent tips issue as it is all dependent on the state of the tangle at the moment of transaction'.

@todofixthis
Copy link
Contributor

todofixthis commented Feb 8, 2018

Hey Marcel. Thanks for suggesting this!

Something just occurred to me — is it possible that the underlying issue here is that the node should be enforcing a minimum value for depth? The minimum value might depend on the state of the Tangle, so it could be variable — perhaps the IRI node should even substitute its own recommended depth if the client provides a value that is too low.

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

No branches or pull requests

2 participants