| 162 | } |
| 163 | |
| 164 | void db_bind_node_id_arr(struct db_stmt *stmt, |
| 165 | const struct node_id *ids) |
| 166 | { |
| 167 | /* Copy into contiguous array: ARM will add padding to struct node_id! */ |
| 168 | size_t n = tal_count(ids); |
| 169 | u8 *arr = tal_arr(stmt, u8, n * sizeof(ids[0].k)); |
| 170 | |
| 171 | for (size_t i = 0; i < n; ++i) { |
| 172 | assert(node_id_valid(&ids[i])); |
| 173 | memcpy(arr + sizeof(ids[i].k) * i, |
| 174 | ids[i].k, |
| 175 | sizeof(ids[i].k)); |
| 176 | } |
| 177 | db_bind_blob(stmt, arr, tal_count(arr)); |
| 178 | } |
| 179 | |
| 180 | void db_bind_pubkey(struct db_stmt *stmt, const struct pubkey *pk) |
| 181 | { |
no test coverage detected