Blockstream / greenlight

Build apps using self-custodial lightning nodes in the cloud
https://blockstream.github.io/greenlight/getting-started/
MIT License
109 stars 27 forks source link

Payments exceeding outbound liquidity take a long time to fail #361

Closed dangeross closed 1 month ago

dangeross commented 7 months ago

When attempting to pay an invoice that exceeds the outbound liquidity of the node, after a long interval the payment eventually times out. Ideally the payment would immediately fail if the node is unable to pay the invoice because of insufficient funds.

Below is an example of a node with an outbound liquidity of 15000 sats trying to pay a 100000 sat invoice and timing out after 150 seconds.

send_payment lnbc1m1pjuulkupp5jh6sheu7cnftf02kd7226xxhdnsg83870l02cgwyvxjuxyvta6lsdqqcqzzsxqrrssrzjqvgptfurj3528snx6e3dtwepafxw5fpzdymw9pj20jj09sunnqmwpapyqqqqqqq005qqqqlgqqqqqqgq9qsp5euqp9hjkg96jaqa78wg9qw7xnqq04vntt0kgsrydh9us2fvhtugs9qyyssqw575vy833rezpjzq92sezgqcz8mngxwdadd7lfqsecednk7gktzhpd9zf7r8czhx5s79nywseppfq3zvayevzq7ep5jh4tpdjr2e8pgp58vx5f

Error: Payment timeout: status: Unknown, message: "Error calling method Pay: RpcError { code: Some(210), message: \"Ran out of routes to try after 31 attempts: see `paystatus`\", data: None }", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Thu, 15 Feb 2024 21:36:45 GMT", "content-length": "0"} }

sdk-20240215.log

cdecker commented 6 months ago

Yes, we should likely do a pre-flight check. I'll see if I can

cdecker commented 1 month ago

This has been addressed with the pre-flight checks: