Let redemption auto submit quit if not enough confirmations#112
Let redemption auto submit quit if not enough confirmations#112
Conversation
Previously the function hanged waiting for bitcoin transactions confirmations. With this change we are adding a possibility to quit the flow in case the confirmations number is insufficient.
| */ | ||
| checkConfirmations: async function(transactionID, requiredConfirmations) { | ||
| return BitcoinHelpers.withElectrumClient(async electrumClient => { | ||
| // TODO: Consider using retry backoff to get transaction. |
There was a problem hiding this comment.
100%, have this in another branch that improves our retries heh.
There was a problem hiding this comment.
I actually question this move. The whole point of autoSubmit is that it runs through the whole submission flow end to end.
I think this requirement is best expressed as a new function of some sort, though I acknowledge that'll probably require some refactoring.
I'm guessing the goal here is when one is trying to model “submit a funding proof if possible” as a flow. To me this means the work broadcastTransactionID does in autoSubmit should be put in its own function, which can be called by an outside caller if they want to get the transaction id. Then they can check confirmations directly, and autoSubmit can continue to operate autonomously until completion when called. Thoughts?
|
Going to hold this guy for now since it's not strictly necessary for tbtc-dapp and the script that is leveraging it is already using this version of the code. |
33d3864 to
662b2c7
Compare
662b2c7 to
f554e6b
Compare
5cc933f to
c58b9ce
Compare
Previously the
autoSubmitfunction hanged waiting for bitcoin transactions confirmations. With this change we are adding a possibility to quit the flow in case the confirmations number is insufficient.