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

Function send_warning

connectd/multiplex.c:179–197  ·  view source on GitHub ↗

Send warning, close connection to peer */

Source from the content-addressed store, hash-verified

177
178/* Send warning, close connection to peer */
179static void send_warning(struct peer *peer, const char *fmt, ...)
180{
181 va_list ap;
182 u8 *msg;
183
184 va_start(ap, fmt);
185 status_vfmt(LOG_UNUSUAL, &peer->id, fmt, ap);
186 va_end(ap);
187
188 va_start(ap, fmt);
189 msg = towire_warningfmtv(NULL, NULL, fmt, ap);
190 va_end(ap);
191
192 inject_peer_msg(peer, take(msg));
193
194 /* Free all the subds immediately */
195 free_all_subds(peer);
196 disconnect_peer(peer);
197}
198
199/* Kicks off write_to_peer() to look for more gossip to send from store */
200static void wake_gossip(struct peer *peer);

Callers 4

handle_ping_inFunction · 0.85
handle_custommsgFunction · 0.85
read_body_from_peer_doneFunction · 0.85

Calls 5

status_vfmtFunction · 0.85
towire_warningfmtvFunction · 0.85
free_all_subdsFunction · 0.85
disconnect_peerFunction · 0.85
inject_peer_msgFunction · 0.70

Tested by

no test coverage detected