| 861 | } |
| 862 | |
| 863 | static 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 | |
| 886 | static void handle_pong_in(struct peer *peer, const u8 *msg) |
| 887 | { |
no test coverage detected