| 775 | } |
| 776 | |
| 777 | static void handle_ping_reply(struct peer *peer, const u8 *msg) |
| 778 | { |
| 779 | u8 *ignored; |
| 780 | size_t i; |
| 781 | |
| 782 | /* We print this out because we asked for pong, so can't spam us... */ |
| 783 | if (!fromwire_pong(msg, msg, &ignored)) |
| 784 | status_peer_unusual(&peer->id, "Got malformed ping reply %s", |
| 785 | tal_hex(tmpctx, msg)); |
| 786 | |
| 787 | /* We print this because dev versions of Core Lightning embed |
| 788 | * version here: see check_ping_make_pong! */ |
| 789 | for (i = 0; i < tal_count(ignored); i++) { |
| 790 | if (ignored[i] < ' ' || ignored[i] == 127) |
| 791 | break; |
| 792 | } |
| 793 | status_debug("Got pong %zu bytes (%.*s...)", |
| 794 | tal_count(ignored), (int)i, (char *)ignored); |
| 795 | daemon_conn_send(peer->daemon->master, |
| 796 | take(towire_connectd_ping_done(NULL, peer->ping_reqid, true, |
| 797 | tal_bytelen(msg)))); |
| 798 | } |
| 799 | |
| 800 | static void handle_pong_in(struct peer *peer, const u8 *msg) |
| 801 | { |
no test coverage detected