The package currently waits a hardcoded second for the connection to succeed and when that times out it leaves the connection in an undetermined state. Increasing the timeout could give someone more certainty the connection actually failed.
This might be legacy code considering usage of WithBlock in lightning-node-connect's grpc.DialOptions is listed as a deprecated antipattern.
Anyway, it's hard to determine, as a consumer of connect, how to recover when the function reports a failure.
Yes I second this, would love to be able to configure the timeout to be a bit longer. It seems to be 50/50 chance of successful connection at times as it times out just before successfully connecting.
The package currently waits a hardcoded second for the connection to succeed and when that times out it leaves the connection in an undetermined state. Increasing the timeout could give someone more certainty the connection actually failed.
This might be legacy code considering usage of
WithBlock
inlightning-node-connect
'sgrpc.DialOptions
is listed as a deprecated antipattern.Anyway, it's hard to determine, as a consumer of
connect
, how to recover when the function reports a failure.https://github.com/lightninglabs/lnc-web/blob/f65cf92b50b3d580072d76a40eff763a97d7a67b/lib/lnc.ts#L226-L250