pay: Add a pre-flight check for the spendable balance

Changelog-Added: pay: The pay plugin now checks whether we have enough spendable capacity before computing a route, returning a clear error message if we don't
This commit is contained in:
Christian Decker
2024-06-19 17:49:08 +02:00
committed by ShahanaFarooqui
parent c2a698069e
commit 82afa8d38c
4 changed files with 119 additions and 9 deletions

View File

@@ -48,6 +48,9 @@ enum jsonrpc_errcode {
PAY_INVOICE_REQUEST_INVALID = 212,
PAY_INVOICE_PREAPPROVAL_DECLINED = 213,
PAY_KEYSEND_PREAPPROVAL_DECLINED = 214,
PAY_INSUFFICIENT_FUNDS = 215,
PAY_UNREACHABLE = 216,
PAY_USER_ERROR = 217,
/* `fundchannel` or `withdraw` errors */
FUND_MAX_EXCEEDED = 300,