psbt: have the unknown map 'add' be a 'set' instead

This commit is contained in:
niftynei
2020-10-09 14:37:15 -05:00
committed by Rusty Russell
parent a7d4b8780e
commit 4034d0c306
7 changed files with 90 additions and 45 deletions

View File

@@ -174,14 +174,14 @@ void psbt_elements_input_init_witness(struct wally_psbt *psbt, size_t in,
const u8 *nonce);
bool psbt_input_set_redeemscript(struct wally_psbt *psbt, size_t in,
const u8 *redeemscript);
/* psbt_input_add_unknown - Add the given Key-Value to the psbt's input keymap
/* psbt_input_set_unknown - Set the given Key-Value in the psbt's input keymap
* @ctx - tal context for allocations
* @in - psbt input to add key-value to
* @in - psbt input to set key-value on
* @key - key for key-value pair
* @value - value to add
* @value - value to set
* @value_len - length of {@value}
*/
void psbt_input_add_unknown(const tal_t *ctx,
void psbt_input_set_unknown(const tal_t *ctx,
struct wally_psbt_input *in,
const u8 *key,
const void *value,
@@ -208,15 +208,15 @@ void *psbt_get_lightning(const struct wally_map *map,
const u8 proprietary_type,
size_t *val_len);
/* psbt_output_add_unknown - Add the given Key-Value to the psbt's output keymap
/* psbt_output_set_unknown - Set the given Key-Value in the psbt's output keymap
*
* @ctx - tal context for allocations
* @out - psbt output to add key-value to
* @out - psbt output to set key-value on
* @key - key for key-value pair
* @value - value to add
* @value - value to set
* @value_len - length of {@value}
*/
void psbt_output_add_unknown(const tal_t *ctx,
void psbt_output_set_unknown(const tal_t *ctx,
struct wally_psbt_output *out,
const u8 *key, const void *value,
size_t value_len);