mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
offers: make it a runtime option.
The fetchinvoice and offers plugins disable themselves if the option isn't enabled (it's enabled by default on EXPERIMENTAL_FEATURES). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: `experimental-offers` enables fetch, payment and creation of (early draft) offers.
This commit is contained in:
committed by
Christian Decker
parent
a4bc3e5673
commit
001b5d6416
@@ -670,6 +670,7 @@ static const char *init(struct plugin *p,
|
||||
const jsmntok_t *config UNUSED)
|
||||
{
|
||||
struct pubkey k;
|
||||
bool exp_offers;
|
||||
|
||||
rpc_scan(p, "getinfo",
|
||||
take(json_out_obj(NULL, NULL, NULL)),
|
||||
@@ -679,9 +680,13 @@ static const char *init(struct plugin *p,
|
||||
abort();
|
||||
|
||||
rpc_scan(p, "listconfigs",
|
||||
take(json_out_obj(NULL, "config", "cltv-final")),
|
||||
"{cltv-final:%}", JSON_SCAN(json_to_number, &cltv_final));
|
||||
take(json_out_obj(NULL, NULL, NULL)),
|
||||
"{cltv-final:%,experimental-offers:%}",
|
||||
JSON_SCAN(json_to_number, &cltv_final),
|
||||
JSON_SCAN(json_to_bool, &exp_offers));
|
||||
|
||||
if (!exp_offers)
|
||||
return "offers not enabled in config";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user