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

Function handle_ping_reply

connectd/multiplex.c:863–884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

861}
862
863static void handle_ping_reply(struct peer *peer, const u8 *msg)
864{
865 u8 *ignored;
866 size_t i;
867
868 /* We print this out because we asked for pong, so can't spam us... */
869 if (!fromwire_pong(msg, msg, &ignored))
870 status_peer_unusual(&peer->id, "Got malformed ping reply %s",
871 tal_hex(tmpctx, msg));
872
873 /* We print this because dev versions of Core Lightning embed
874 * version here: see check_ping_make_pong! */
875 for (i = 0; i < tal_count(ignored); i++) {
876 if (ignored[i] < ' ' || ignored[i] == 127)
877 break;
878 }
879 status_debug("Got pong %zu bytes (%.*s...)",
880 tal_count(ignored), (int)i, (char *)ignored);
881 daemon_conn_send(peer->daemon->master,
882 take(towire_connectd_ping_done(NULL, peer->ping_reqid, true,
883 tal_bytelen(msg))));
884}
885
886static void handle_pong_in(struct peer *peer, const u8 *msg)
887{

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