| 1168 | } |
| 1169 | |
| 1170 | static struct io_plan *read_hdr_from_peer(struct io_conn *peer_conn, |
| 1171 | struct peer *peer) |
| 1172 | { |
| 1173 | assert(peer->to_peer == peer_conn); |
| 1174 | |
| 1175 | /* BOLT #8: |
| 1176 | * |
| 1177 | * ### Receiving and Decrypting Messages |
| 1178 | * |
| 1179 | * In order to decrypt the _next_ message in the network |
| 1180 | * stream, the following steps are completed: |
| 1181 | * |
| 1182 | * 1. Read _exactly_ 18 bytes from the network buffer. |
| 1183 | */ |
| 1184 | peer->peer_in = tal_arr(peer, u8, CRYPTOMSG_HDR_SIZE); |
| 1185 | return io_read(peer_conn, peer->peer_in, CRYPTOMSG_HDR_SIZE, |
| 1186 | read_body_from_peer, peer); |
| 1187 | } |
| 1188 | |
| 1189 | static struct io_plan *subd_conn_init(struct io_conn *subd_conn, |
| 1190 | struct subd *subd) |
no outgoing calls
no test coverage detected