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

Function handle_custommsg

connectd/multiplex.c:719–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717}
718
719static bool handle_custommsg(struct daemon *daemon,
720 struct peer *peer,
721 const u8 *msg)
722{
723 enum peer_wire type = fromwire_peektype(msg);
724 if (type % 2 == 1 && !peer_wire_is_defined(type)) {
725 /* The message is not part of the messages we know how to
726 * handle. Assuming this is a custommsg, we just forward it to the
727 * master. */
728 status_peer_io(LOG_IO_IN, &peer->id, msg);
729 daemon_conn_send(daemon->master,
730 take(towire_connectd_custommsg_in(NULL,
731 &peer->id,
732 msg)));
733 return true;
734 } else {
735 return false;
736 }
737}
738
739/* We handle pings and gossip messages. */
740static bool handle_message_locally(struct peer *peer, const u8 *msg)

Callers 1

handle_message_locallyFunction · 0.70

Calls 3

fromwire_peektypeFunction · 0.50
status_peer_ioFunction · 0.50
daemon_conn_sendFunction · 0.50

Tested by

no test coverage detected