stakwork / sphinx-key

Lightning hardware signer on ESP32
29 stars 1 forks source link

broker: add to client list only after completion of reconnect dance #98

Closed irriden closed 1 year ago

irriden commented 1 year ago

Close #97

@Evanfeenstra no rush - when you can let me know what you think of the overall approach here.

Most noteworthy - when sending to a specific client - I remove the check on its presence in the client list.

Is this even an issue worth addressing ? Still open to other ways of thinking about this.

irriden commented 1 year ago

And d4aa398 potentially closes #96.

Should we instead only fail after x number of retries ?

Key is to return at some point if we never get a response :)

Evanfeenstra commented 1 year ago

seems like a fine approach, but i wonder if there is a simpler way to achieve the same result (simply not wait forever if the message is not from CLN directly)

dance_complete_rx.recv().expect is probably not ideal, it will kill the reconnect thread if that expect is ever called. You can check if let Ok() instead maybe