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

Function onionmsg_req

connectd/onion_message.c:19–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include <wire/peer_wire.h>
18
19void onionmsg_req(struct daemon *daemon, const u8 *msg)
20{
21 struct node_id id;
22 u8 *onionmsg;
23 struct pubkey blinding;
24 struct peer *peer;
25
26 if (!fromwire_connectd_send_onionmsg(msg, msg, &id, &onionmsg, &blinding))
27 master_badmsg(WIRE_CONNECTD_SEND_ONIONMSG, msg);
28
29 /* Even though lightningd checks for valid ids, there's a race
30 * where it might vanish before we read this command. */
31 peer = peer_htable_get(&daemon->peers, &id);
32 if (peer) {
33 u8 *omsg = towire_onion_message(NULL, &blinding, onionmsg);
34 inject_peer_msg(peer, take(omsg));
35 }
36}
37
38/* Peer sends an onion msg. */
39void handle_onion_message(struct daemon *daemon,

Callers 1

recv_reqFunction · 0.85

Calls 2

inject_peer_msgFunction · 0.85
master_badmsgFunction · 0.50

Tested by

no test coverage detected