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

Function psbt_make_key

bitcoin/psbt.c:487–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485#define LIGHTNING_PROPRIETARY_PREFIX "lightning"
486
487u8 *psbt_make_key(const tal_t *ctx, u8 key_subtype, const u8 *key_data)
488{
489 /**
490 * BIP174:
491 * Type: Proprietary Use Type <tt>PSBT_GLOBAL_PROPRIETARY = 0xFC</tt>
492 ** Key: Variable length identifier prefix, followed
493 * by a subtype, followed by the key data itself.
494 *** <tt>{0xFC}|<prefix>|{subtype}|{key data}</tt>
495 ** Value: Any value data as defined by the proprietary type user.
496 *** <tt><data></tt>
497 */
498 u8 *key = tal_arr(ctx, u8, 0);
499 add_type(&key, PSBT_PROPRIETARY_TYPE);
500 add_varint(&key, strlen(LIGHTNING_PROPRIETARY_PREFIX));
501 add(&key, LIGHTNING_PROPRIETARY_PREFIX,
502 strlen(LIGHTNING_PROPRIETARY_PREFIX));
503 add_type(&key, key_subtype);
504 if (key_data)
505 add(&key, key_data, tal_bytelen(key_data));
506 return key;
507}
508
509static bool wally_map_set_unknown(const tal_t *ctx,
510 struct wally_map *map,

Callers 6

psbt_get_lightningFunction · 0.85
psbt_input_set_serial_idFunction · 0.85
psbt_input_mark_oursFunction · 0.85
mainFunction · 0.85

Calls 4

add_typeFunction · 0.85
add_varintFunction · 0.85
tal_bytelenFunction · 0.85
addFunction · 0.70

Tested by 1

mainFunction · 0.68