| 599 | } |
| 600 | |
| 601 | static void handle_ping_in(struct peer *peer, const u8 *msg) |
| 602 | { |
| 603 | u8 *pong; |
| 604 | |
| 605 | /* gossipd doesn't log IO, so we log it here. */ |
| 606 | status_peer_io(LOG_IO_IN, &peer->id, msg); |
| 607 | |
| 608 | if (!check_ping_make_pong(NULL, msg, &pong)) { |
| 609 | send_warning(peer, "Invalid ping %s", tal_hex(msg, msg)); |
| 610 | return; |
| 611 | } |
| 612 | |
| 613 | if (pong) |
| 614 | inject_peer_msg(peer, take(pong)); |
| 615 | } |
| 616 | |
| 617 | static void handle_ping_reply(struct peer *peer, const u8 *msg) |
| 618 | { |
no test coverage detected