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

Function handle_ping_reply

connectd/multiplex.c:777–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777static void handle_ping_reply(struct peer *peer, const u8 *msg)
778{
779 u8 *ignored;
780 size_t i;
781
782 /* We print this out because we asked for pong, so can't spam us... */
783 if (!fromwire_pong(msg, msg, &ignored))
784 status_peer_unusual(&peer->id, "Got malformed ping reply %s",
785 tal_hex(tmpctx, msg));
786
787 /* We print this because dev versions of Core Lightning embed
788 * version here: see check_ping_make_pong! */
789 for (i = 0; i < tal_count(ignored); i++) {
790 if (ignored[i] < ' ' || ignored[i] == 127)
791 break;
792 }
793 status_debug("Got pong %zu bytes (%.*s...)",
794 tal_count(ignored), (int)i, (char *)ignored);
795 daemon_conn_send(peer->daemon->master,
796 take(towire_connectd_ping_done(NULL, peer->ping_reqid, true,
797 tal_bytelen(msg))));
798}
799
800static void handle_pong_in(struct peer *peer, const u8 *msg)
801{

Callers 1

handle_pong_inFunction · 0.85

Calls 3

tal_hexFunction · 0.85
daemon_conn_sendFunction · 0.85
tal_bytelenFunction · 0.85

Tested by

no test coverage detected