| 9 | #include <common/utils.h> |
| 10 | |
| 11 | bool psbt_get_serial_id(const struct wally_map *map, u64 *serial_id) |
| 12 | { |
| 13 | size_t value_len; |
| 14 | beint64_t bev; |
| 15 | void *result = psbt_get_lightning(map, PSBT_TYPE_SERIAL_ID, &value_len); |
| 16 | if (!result) |
| 17 | return false; |
| 18 | |
| 19 | if (value_len != sizeof(bev)) |
| 20 | return false; |
| 21 | |
| 22 | memcpy(&bev, result, value_len); |
| 23 | *serial_id = be64_to_cpu(bev); |
| 24 | return true; |
| 25 | } |
| 26 | |
| 27 | static int compare_serials(const struct wally_map *map_a, |
| 28 | const struct wally_map *map_b) |
no test coverage detected