Description
With my low bandwidth (mesh net) application, I can send and receive all messages just fine, as timings do not appear to be an issue.
However, when specifically trying to pay an invoice, I encountered repeated errors, only manifested by C-Lightning closing the socket (to my proxy) with no additional messaging sent.
After much hunting, I have found the cause of the issue:
lightning/lightningd/peer_htlcs.c
Line 465 in 0495295
The timeout on L468 was causing payer to close the [edited]: s/channel/socket abruptly after 30 seconds, but I needed in the order of 180 seconds to send the first HTLC! Once I modified this to 300 seconds the failures were no longer.
I would propose that this either be increased, or if the UI associated with this is not desirable, allow it to be configured via an lightning-cli
RPC command. This would allow our mesh net users to be able to pay lightning invoices in the future without needing to run a custom patched (and compiled) version of C-Lightning.
I don't see any security risk associated with doing this, as HTLCs are already "non-cancelable" once in-flight, and this only increased the time allowed for them to get there.