diff --git a/lightningd/onion_message.c b/lightningd/onion_message.c index 0e4fcc56d..8a5afbff9 100644 --- a/lightningd/onion_message.c +++ b/lightningd/onion_message.c @@ -125,7 +125,7 @@ void handle_obs_onionmsg_to_us(struct lightningd *ld, const u8 *msg) payload->reply_path = tal_free(payload->reply_path); } - log_debug(ld->log, "Got onionmsg%s%s", + log_debug(ld->log, "Got obsolete onionmsg%s%s", payload->reply_blinding ? " reply_blinding": "", payload->reply_path ? " reply_path": ""); @@ -389,10 +389,10 @@ static void populate_tlvs(struct hop *hops, } } -static struct command_result *json_send_onion_message(struct command *cmd, - const char *buffer, - const jsmntok_t *obj UNNEEDED, - const jsmntok_t *params) +static struct command_result *json_send_obs_onion_message(struct command *cmd, + const char *buffer, + const jsmntok_t *obj UNNEEDED, + const jsmntok_t *params) { struct hop *hops; struct tlv_onionmsg_payload_obs_reply_path *reply_path; @@ -447,10 +447,10 @@ static struct command_result *json_send_onion_message(struct command *cmd, return command_success(cmd, json_stream_success(cmd)); } -static const struct json_command send_onion_message_command = { - "sendonionmessage", +static const struct json_command send_obs_onion_message_command = { + "sendobsonionmessage", "utility", - json_send_onion_message, + json_send_obs_onion_message, "Send message over {hops} (id, [short_channel_id], [blinding], [enctlv], [invoice], [invoice_request], [invoice_error], [rawtlv]) with optional {reply_path} (blinding, path[id, enctlv])" }; -AUTODATA(json_command, &send_onion_message_command); +AUTODATA(json_command, &send_obs_onion_message_command); diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index 304e0acb9..969fc1a76 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -649,7 +649,7 @@ static struct command_result *send_message(struct command *cmd, path = make_blindedpath(tmpctx, backwards, &blinding, &sent->reply_blinding); - req = jsonrpc_request_start(cmd->plugin, cmd, "sendonionmessage", + req = jsonrpc_request_start(cmd->plugin, cmd, "sendobsonionmessage", done, forward_error, sent); diff --git a/plugins/offers.c b/plugins/offers.c index 656f422f0..ef8b7d3b1 100644 --- a/plugins/offers.c +++ b/plugins/offers.c @@ -52,7 +52,7 @@ send_onion_reply(struct command *cmd, replyfield, tal_hex(tmpctx, replydata)); /* Send to requester, using return route. */ - req = jsonrpc_request_start(cmd->plugin, cmd, "sendonionmessage", + req = jsonrpc_request_start(cmd->plugin, cmd, "sendobsonionmessage", finished, sendonionmessage_error, NULL); /* Add reply into last hop. */ diff --git a/tests/plugins/onionmessage-reply.py b/tests/plugins/onionmessage-reply.py index a717e0c13..3099aae5b 100755 --- a/tests/plugins/onionmessage-reply.py +++ b/tests/plugins/onionmessage-reply.py @@ -13,7 +13,7 @@ def on_onion_message(plugin, onion_message, **kwargs): plugin.log("no reply path") return - plugin.rpc.call('sendonionmessage', [onion_message['reply_path']]) + plugin.rpc.call('sendobsonionmessage', [onion_message['reply_path']]) plugin.log("Got onion_message invoice '{}'".format(onion_message['invoice'])) plugin.log("Sent reply via {}".format(onion_message['reply_path'])) return {"result": "continue"} diff --git a/tests/test_misc.py b/tests/test_misc.py index ec274dc8e..246798d14 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2335,24 +2335,24 @@ def test_sendcustommsg(node_factory): ]) -def test_sendonionmessage(node_factory): +def test_sendobsonionmessage(node_factory): l1, l2, l3 = node_factory.line_graph(3, opts={'experimental-onion-messages': None}) blindedpathtool = os.path.join(os.path.dirname(__file__), "..", "devtools", "blindedpath") - l1.rpc.call('sendonionmessage', + l1.rpc.call('sendobsonionmessage', {'hops': [{'id': l2.info['id']}, {'id': l3.info['id']}]}) - assert l3.daemon.wait_for_log('Got onionmsg') + assert l3.daemon.wait_for_log('Got obsolete onionmsg') # Now by SCID. - l1.rpc.call('sendonionmessage', + l1.rpc.call('sendobsonionmessage', {'hops': [{'id': l2.info['id'], 'short_channel_id': l2.get_channel_scid(l3)}, {'id': l3.info['id']}]}) - assert l3.daemon.wait_for_log('Got onionmsg') + assert l3.daemon.wait_for_log('Got obsolete onionmsg') # Now test blinded path. output = subprocess.check_output( @@ -2364,17 +2364,17 @@ def test_sendonionmessage(node_factory): # First hop can't be blinded! assert p1 == l2.info['id'] - l1.rpc.call('sendonionmessage', + l1.rpc.call('sendobsonionmessage', {'hops': [{'id': l2.info['id'], 'blinding': blinding, 'enctlv': p1enc}, {'id': p2}]}) - assert l3.daemon.wait_for_log('Got onionmsg') + assert l3.daemon.wait_for_log('Got obsolete onionmsg') -@unittest.skipIf(not EXPERIMENTAL_FEATURES, "Needs sendonionmessage") -def test_sendonionmessage_reply(node_factory): +@unittest.skipIf(not EXPERIMENTAL_FEATURES, "Needs sendobsonionmessage") +def test_sendobsonionmessage_reply(node_factory): blindedpathtool = os.path.join(os.path.dirname(__file__), "..", "devtools", "blindedpath") plugin = os.path.join(os.path.dirname(__file__), "plugins", "onionmessage-reply.py") @@ -2391,7 +2391,7 @@ def test_sendonionmessage_reply(node_factory): assert p1 == l2.info['id'] # Also tests oversize payload which won't fit in 1366-byte onion. - l1.rpc.call('sendonionmessage', + l1.rpc.call('sendobsonionmessage', {'hops': [{'id': l2.info['id']}, {'id': l3.info['id'], @@ -2400,10 +2400,10 @@ def test_sendonionmessage_reply(node_factory): {'blinding': blinding, 'path': [{'id': p1, 'enctlv': p1enc}, {'id': p2}]}}) - assert l3.daemon.wait_for_log('Got onionmsg reply_blinding reply_path') + assert l3.daemon.wait_for_log('Got obsolete onionmsg reply_blinding reply_path') assert l3.daemon.wait_for_log("Got onion_message invoice '{}'".format('77' * 15000)) assert l3.daemon.wait_for_log('Sent reply via') - assert l1.daemon.wait_for_log('Got onionmsg') + assert l1.daemon.wait_for_log('Got obsolete onionmsg') @pytest.mark.developer("needs --dev-force-privkey")