lightning-kmp icon indicating copy to clipboard operation
lightning-kmp copied to clipboard

Retrieve feerates everytime we reconnect to electrum

Open pm47 opened this issue 1 year ago • 2 comments

Before this change, we were only retrieving the feerates once during the lifetime of the app. If we happen to connect to an unhealthy Electrum server (connection succeeds, but then we get ServerError(request=EstimateFees(confirmations=18), error=JsonRPCError(code=-102, message=server busy - request timed out))), then the app will fail to start and actually crash.

This change is more subtle than it may look. Not only do we catch and ignore errors, but we also retrieve feerates at each reconnection. The goal is that in the scenario above we would try another electrum server and get back on our feet.

⚠️ It's very hard to test and I'm not sure of the side effects.

pm47 avatar Jun 23 '23 14:06 pm47

Since we want to retrieve onchain fee rate each time we connect to an electrum server, and that some may fail to return a valid response, another approach would be to add retrieving fee rates to the handshake we perform when we establish a new connection, see https://github.com/ACINQ/lightning-kmp/pull/490 ?

sstone avatar Jun 27 '23 07:06 sstone

Isn't this obsolete after #649 where we let our peer advertise the feerates they accept through the recommended_feerates message?

t-bast avatar Sep 18 '24 13:09 t-bast