| 798 | } |
| 799 | |
| 800 | static 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! */ |
no test coverage detected