xpay: support paying a (simple) bolt12 offer directly.
fetchinvoice is still good for detailed diagnostics and handling recurring invoices and alternate currencies, but this covers the "throw some sats" case well. Changelog-Added: JSON-RPC: `xpay` can now pay a simple offer directly, rather than requiring fetchinvoice first. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -594,7 +594,7 @@ static bool bolt12_has_request_prefix(const char *str)
|
||||
return strstarts(str, "lnr1") || strstarts(str, "LNR1");
|
||||
}
|
||||
|
||||
static bool bolt12_has_offer_prefix(const char *str)
|
||||
bool bolt12_has_offer_prefix(const char *str)
|
||||
{
|
||||
return strstarts(str, "lno1") || strstarts(str, "LNO1");
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ void offer_period_paywindow(const struct recurrence *recurrence,
|
||||
/**
|
||||
* Preliminary prefix check to see if the string might be a bolt12 string.
|
||||
*/
|
||||
bool bolt12_has_offer_prefix(const char *str);
|
||||
bool bolt12_has_prefix(const char *str);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user