| 235 | } |
| 236 | |
| 237 | void psbt_set_channel_ids(struct wally_psbt *psbt, |
| 238 | struct channel_id *channel_ids) |
| 239 | { |
| 240 | BUILD_ASSERT(sizeof(channel_ids[0].id) == 32); |
| 241 | int data_size = tal_count(channel_ids) * 32; |
| 242 | u8 *data = tal_arr(tmpctx, u8, data_size); |
| 243 | |
| 244 | for (size_t i = 0; i < tal_count(channel_ids); i++) |
| 245 | memcpy(data + i * 32, channel_ids[i].id, 32); |
| 246 | |
| 247 | psbt_set_lightning(psbt, |
| 248 | &psbt->unknowns, |
| 249 | PSBT_TYPE_CHANNELIDS, |
| 250 | data, |
| 251 | data_size); |
| 252 | } |
| 253 | |
| 254 | /* psbt_set_channel_ids - Stores the channel_ids in the PSBT |
| 255 | * |
no test coverage detected