| 615 | } |
| 616 | |
| 617 | static void handle_ping_reply(struct peer *peer, const u8 *msg) |
| 618 | { |
| 619 | u8 *ignored; |
| 620 | size_t i; |
| 621 | |
| 622 | /* We print this out because we asked for pong, so can't spam us... */ |
| 623 | if (!fromwire_pong(msg, msg, &ignored)) |
| 624 | status_peer_unusual(&peer->id, "Got malformed ping reply %s", |
| 625 | tal_hex(tmpctx, msg)); |
| 626 | |
| 627 | /* We print this because dev versions of Core Lightning embed |
| 628 | * version here: see check_ping_make_pong! */ |
| 629 | for (i = 0; i < tal_count(ignored); i++) { |
| 630 | if (ignored[i] < ' ' || ignored[i] == 127) |
| 631 | break; |
| 632 | } |
| 633 | status_debug("Got pong %zu bytes (%.*s...)", |
| 634 | tal_count(ignored), (int)i, (char *)ignored); |
| 635 | daemon_conn_send(peer->daemon->master, |
| 636 | take(towire_connectd_ping_reply(NULL, true, |
| 637 | tal_bytelen(msg)))); |
| 638 | } |
| 639 | |
| 640 | static void handle_pong_in(struct peer *peer, const u8 *msg) |
| 641 | { |
no test coverage detected