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

Function add_scid_map

connectd/connectd.c:2100–2117  ·  view source on GitHub ↗

lightningd tells us about a new short_channel_id for a peer. */

Source from the content-addressed store, hash-verified

2098
2099/* lightningd tells us about a new short_channel_id for a peer. */
2100static void add_scid_map(struct daemon *daemon, const u8 *msg)
2101{
2102 struct scid_to_node_id *scid_to_node_id, *old;
2103
2104 scid_to_node_id = tal(daemon->scid_htable, struct scid_to_node_id);
2105 if (!fromwire_connectd_scid_map(msg,
2106 &scid_to_node_id->scid,
2107 &scid_to_node_id->node_id))
2108 master_badmsg(WIRE_CONNECTD_SCID_MAP, msg);
2109
2110 /* Make sure we clean up any old entries */
2111 old = scid_htable_get(daemon->scid_htable, scid_to_node_id->scid);
2112 if (old) {
2113 scid_htable_del(daemon->scid_htable, old);
2114 tal_free(old);
2115 }
2116 scid_htable_add(daemon->scid_htable, scid_to_node_id);
2117}
2118
2119static void dev_connect_memleak(struct daemon *daemon, const u8 *msg)
2120{

Callers 1

recv_reqFunction · 0.85

Calls 2

tal_freeFunction · 0.85
master_badmsgFunction · 0.50

Tested by

no test coverage detected