Closed ok300 closed 6 months ago
That's right. Ideally I IMO the background thread would be the single point of tracking swap statuses and handle them (claim or refund). This thread can emit events for the payment lifecycle (success/fail/refund) which will be handled by the send_payment waiting until some timeout.
The
send_payment
has its own socket and its own status handling loop.There is a lot of overlap with
BoltzStatusStream
for the socket handling, and withtry_handle_submarine_swap_status
for the state transition handling.There is also a chance of race conditions with the status stream socket, whereby the new Send swap could be handled by both loops.
We should try to reuse the existing methods.