| 137 | } |
| 138 | |
| 139 | void db_bind_node_id_arr(struct db_stmt *stmt, int col, |
| 140 | const struct node_id *ids) |
| 141 | { |
| 142 | /* Copy into contiguous array: ARM will add padding to struct node_id! */ |
| 143 | size_t n = tal_count(ids); |
| 144 | u8 *arr = tal_arr(stmt, u8, n * sizeof(ids[0].k)); |
| 145 | |
| 146 | for (size_t i = 0; i < n; ++i) { |
| 147 | assert(node_id_valid(&ids[i])); |
| 148 | memcpy(arr + sizeof(ids[i].k) * i, |
| 149 | ids[i].k, |
| 150 | sizeof(ids[i].k)); |
| 151 | } |
| 152 | db_bind_blob(stmt, col, arr, tal_count(arr)); |
| 153 | } |
| 154 | |
| 155 | void db_bind_pubkey(struct db_stmt *stmt, int pos, const struct pubkey *pk) |
| 156 | { |
no test coverage detected