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

Function handle_pong_in

connectd/multiplex.c:800–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798}
799
800static void handle_pong_in(struct peer *peer, const u8 *msg)
801{
802 switch (peer->expecting_pong) {
803 case PONG_EXPECTED_COMMAND:
804 handle_ping_reply(peer, msg);
805 /* fall thru */
806 case PONG_EXPECTED_PROBING:
807 peer->expecting_pong = PONG_UNEXPECTED;
808 daemon_conn_send(peer->daemon->master,
809 take(towire_connectd_ping_latency(NULL,
810 &peer->id,
811 time_to_nsec(timemono_since(peer->ping_start)))));
812 return;
813 case PONG_UNEXPECTED:
814 status_debug("Unexpected pong?");
815 return;
816 }
817 abort();
818}
819
820/* Various cases where we don't send the msg to a gossipd, we want to
821 * do IO logging! */

Callers 1

handle_message_locallyFunction · 0.85

Calls 5

handle_ping_replyFunction · 0.85
daemon_conn_sendFunction · 0.85
time_to_nsecFunction · 0.85
timemono_sinceFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected