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

Function gossip_msg

lightningd/gossip_control.c:148–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds)
149{
150 enum gossipd_wire t = fromwire_peektype(msg);
151
152 switch (t) {
153 /* These are messages we send, not them. */
154 case WIRE_GOSSIPD_INIT:
155 case WIRE_GOSSIPD_GET_TXOUT_REPLY:
156 case WIRE_GOSSIPD_OUTPOINTS_SPENT:
157 case WIRE_GOSSIPD_NEW_LEASE_RATES:
158 case WIRE_GOSSIPD_DEV_SET_MAX_SCIDS_ENCODE_SIZE:
159 case WIRE_GOSSIPD_LOCAL_CHANNEL_CLOSE:
160 case WIRE_GOSSIPD_DEV_MEMLEAK:
161 case WIRE_GOSSIPD_DEV_COMPACT_STORE:
162 case WIRE_GOSSIPD_DEV_SET_TIME:
163 case WIRE_GOSSIPD_NEW_BLOCKHEIGHT:
164 case WIRE_GOSSIPD_ADDGOSSIP:
165 case WIRE_GOSSIPD_GET_ADDRS:
166 case WIRE_GOSSIPD_USED_LOCAL_CHANNEL_UPDATE:
167 case WIRE_GOSSIPD_LOCAL_CHANNEL_UPDATE:
168 case WIRE_GOSSIPD_LOCAL_CHANNEL_ANNOUNCEMENT:
169 case WIRE_GOSSIPD_LOCAL_PRIVATE_CHANNEL:
170 /* This is a reply, so never gets through to here. */
171 case WIRE_GOSSIPD_INIT_REPLY:
172 case WIRE_GOSSIPD_DEV_MEMLEAK_REPLY:
173 case WIRE_GOSSIPD_DEV_COMPACT_STORE_REPLY:
174 case WIRE_GOSSIPD_ADDGOSSIP_REPLY:
175 case WIRE_GOSSIPD_NEW_BLOCKHEIGHT_REPLY:
176 case WIRE_GOSSIPD_GET_ADDRS_REPLY:
177 case WIRE_GOSSIPD_DISCOVERED_IP:
178 break;
179
180 case WIRE_GOSSIPD_GET_TXOUT:
181 get_txout(gossip, msg);
182 break;
183 case WIRE_GOSSIPD_GOT_LOCAL_CHANNEL_UPDATE:
184 handle_local_channel_update(gossip->ld, msg);
185 break;
186 }
187 return 0;
188}
189
190static void gossipd_new_blockheight_reply(struct subd *gossipd,
191 const u8 *reply,

Callers

nothing calls this directly

Calls 3

get_txoutFunction · 0.85
fromwire_peektypeFunction · 0.50

Tested by

no test coverage detected