stakwork / sphinx-key

Lightning hardware signer on ESP32
28 stars 1 forks source link

Signer waits forever if the LSS init tries from broker don't make it #99

Closed irriden closed 12 months ago

irriden commented 12 months ago

In that scenario, signer never gets added to the client list, and the LSS dance is never retried, as the signer never reconnects.

So we get completely stuck.

Propose to add the recv_timeout, https://doc.rust-lang.org/stable/std/sync/mpsc/struct.Receiver.html#method.recv_timeout, here:

https://github.com/stakwork/sphinx-key/blob/7e290da6a62899aa59026f1f659ad1ad9aaa8728/sphinx-key/src/core/lss.rs#L15-L22

As well as the other recv() call for the INIT_2 message further below.

How long should the timeout be? 30 secs?