| 747 | } |
| 748 | |
| 749 | void send_custommsg(struct daemon *daemon, const u8 *msg) |
| 750 | { |
| 751 | struct node_id id; |
| 752 | u8 *custommsg; |
| 753 | struct peer *peer; |
| 754 | |
| 755 | if (!fromwire_connectd_custommsg_out(tmpctx, msg, &id, &custommsg)) |
| 756 | master_badmsg(WIRE_CONNECTD_CUSTOMMSG_OUT, msg); |
| 757 | |
| 758 | /* Races can happen: this might be gone by now. */ |
| 759 | peer = peer_htable_get(daemon->peers, &id); |
| 760 | if (peer) |
| 761 | inject_peer_msg(peer, take(custommsg)); |
| 762 | } |
| 763 | |
| 764 | static void handle_ping_in(struct peer *peer, const u8 *msg) |
| 765 | { |
no test coverage detected