MCPcopy Create free account
hub / github.com/ElementsProject/lightning / psbt_set_keypath

Function psbt_set_keypath

common/psbt_keypath.c:8–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <wally_psbt.h>
7
8void 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
24void psbt_add_keypath_to_last_output(struct bitcoin_tx *tx,
25 u32 key_index,

Callers 2

Calls 1

abortFunction · 0.85

Tested by

no test coverage detected