| 6 | #include <wally_psbt.h> |
| 7 | |
| 8 | void psbt_set_keypath(u32 index, const struct ext_key *ext, struct wally_map *map_in) { |
| 9 | u8 fingerprint[BIP32_KEY_FINGERPRINT_LEN]; |
| 10 | if (bip32_key_get_fingerprint( |
| 11 | (struct ext_key *) ext, fingerprint, sizeof(fingerprint)) != WALLY_OK) |
| 12 | abort(); |
| 13 | |
| 14 | u32 path[1]; |
| 15 | path[0] = index; |
| 16 | |
| 17 | if (wally_map_add_keypath_item(map_in, |
| 18 | ext->pub_key, sizeof(ext->pub_key), |
| 19 | fingerprint, sizeof(fingerprint), |
| 20 | path, 1) != WALLY_OK) |
| 21 | abort(); |
| 22 | } |
| 23 | |
| 24 | void psbt_add_keypath_to_last_output(struct bitcoin_tx *tx, |
| 25 | u32 key_index, |
no test coverage detected