MCPcopy Create free account
hub / github.com/ElementsProject/lightning / on_onion_message

Function on_onion_message

tests/plugins/onionmessage-reply.py:11–19  ·  view source on GitHub ↗
(plugin, onion_message, **kwargs)

Source from the content-addressed store, hash-verified

9
10@plugin.hook("onion_message")
11def on_onion_message(plugin, onion_message, **kwargs):
12 if 'reply_path' not in onion_message:
13 plugin.log("no reply path")
14 return
15
16 plugin.rpc.call('sendobsonionmessage', [onion_message['reply_path']])
17 plugin.log("Got onion_message invoice '{}'".format(onion_message['invoice']))
18 plugin.log("Sent reply via {}".format(onion_message['reply_path']))
19 return {"result": "continue"}
20
21
22plugin.run()

Callers

nothing calls this directly

Calls 2

logMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected