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

Function handle_ping_reply

connectd/multiplex.c:617–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615}
616
617static void handle_ping_reply(struct peer *peer, const u8 *msg)
618{
619 u8 *ignored;
620 size_t i;
621
622 /* We print this out because we asked for pong, so can't spam us... */
623 if (!fromwire_pong(msg, msg, &ignored))
624 status_peer_unusual(&peer->id, "Got malformed ping reply %s",
625 tal_hex(tmpctx, msg));
626
627 /* We print this because dev versions of Core Lightning embed
628 * version here: see check_ping_make_pong! */
629 for (i = 0; i < tal_count(ignored); i++) {
630 if (ignored[i] < ' ' || ignored[i] == 127)
631 break;
632 }
633 status_debug("Got pong %zu bytes (%.*s...)",
634 tal_count(ignored), (int)i, (char *)ignored);
635 daemon_conn_send(peer->daemon->master,
636 take(towire_connectd_ping_reply(NULL, true,
637 tal_bytelen(msg))));
638}
639
640static void handle_pong_in(struct peer *peer, const u8 *msg)
641{

Callers 1

handle_pong_inFunction · 0.85

Calls 3

tal_hexFunction · 0.85
tal_bytelenFunction · 0.85
daemon_conn_sendFunction · 0.50

Tested by

no test coverage detected