lightningd tells us about a new short_channel_id for a peer. */
| 2098 | |
| 2099 | /* lightningd tells us about a new short_channel_id for a peer. */ |
| 2100 | static 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 | |
| 2119 | static void dev_connect_memleak(struct daemon *daemon, const u8 *msg) |
| 2120 | { |
no test coverage detected