Skip to content

Commit f7b066b

Browse files
committed
xpay: provide notifications while fetching BIP353 and doing fetchinvoice.
Otherwise cmdline just sees a long pause. Signed-off-by: Rusty Russell <[email protected]>
1 parent 2b92f7d commit f7b066b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

plugins/xpay/xpay.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,8 @@ do_fetchinvoice(struct command *cmd, const char *offerstr, struct xpay_params *x
17181718
{
17191719
struct out_req *req;
17201720

1721+
plugin_notify_message(cmd, LOG_INFORM, "Fetching invoice for offer");
1722+
plugin_notify_message(cmd, LOG_DBG, "offer is %s", offerstr);
17211723
req = jsonrpc_request_start(cmd, "fetchinvoice",
17221724
invoice_fetched,
17231725
forward_error,
@@ -1831,6 +1833,7 @@ static struct command_result *json_xpay_params(struct command *cmd,
18311833
if (command_check_only(cmd))
18321834
return command_check_done(cmd);
18331835

1836+
plugin_notify_message(cmd, LOG_INFORM, "DNS lookup for %s", invstring);
18341837
req = jsonrpc_request_start(cmd, "fetchbip353",
18351838
bip353_fetched,
18361839
forward_error, xparams);

tests/test_xpay.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,3 +1017,8 @@ def test_xpay_bip353(node_factory):
10171017
# - `name` set to the post-₿, pre-@ part of the BIP 353 HRN,
10181018
# - `domain` set to the post-@ part of the BIP 353 HRN.
10191019
assert l1.rpc.decode(only_one(l1.rpc.listinvoices()['invoices'])['bolt12'])['invreq_bip_353_name'] == {'name': 'fake', 'domain': 'fake.com'}
1020+
1021+
# We provide notifications of progress!
1022+
l2.daemon.wait_for_log('plugin-cln-xpay: notify msg info: DNS lookup for [email protected]')
1023+
l2.daemon.wait_for_log('plugin-cln-xpay: notify msg info: Fetching invoice for offer')
1024+
l2.daemon.wait_for_log(f'plugin-cln-xpay: notify msg debug: offer is {offer}')

0 commit comments

Comments
 (0)