rfc-dual-fund: update to latest spec for dual-funding

- Renamed zerod_channel_ids to temporary_channel_id
- Renamed witness_stack->witnesses
- Renamed witness_element->witness_elements
- open_channel2 now includes second commitment point
- accept_channel2 now includes second commitment point

Current commit on rfc branch 64f7f360b9f3c2664d078e2129cfe83098fc4617

Changelog-EXPERIMENTAL: Protocol: dual-funding spec changed in incompatible ways, won't work with old versions (but maybe soon with Eclair!!)
This commit is contained in:
niftynei
2023-02-02 17:32:35 -06:00
committed by Rusty Russell
parent 3586559fac
commit f465032f6f
4 changed files with 81 additions and 15 deletions

View File

@@ -17,8 +17,8 @@ psbt_input_set_final_witness_stack(const tal_t *ctx,
for (size_t i = 0; i < tal_count(elements); i++)
wally_tx_witness_stack_add(in->final_witness,
elements[i]->witness,
tal_bytelen(elements[i]->witness));
elements[i]->witness_data,
tal_bytelen(elements[i]->witness_data));
tal_wally_end(ctx);
}
@@ -78,13 +78,13 @@ psbt_to_witness_stacks(const tal_t *ctx,
tal(stacks, struct witness_stack);
/* Convert the wally_tx_witness_stack to
* a witness_stack entry */
stack->witness_element =
stack->witness_elements =
tal_arr(stack, struct witness_element *,
wtx_s->num_items);
for (size_t j = 0; j < tal_count(stack->witness_element); j++) {
stack->witness_element[j] = tal(stack,
for (size_t j = 0; j < tal_count(stack->witness_elements); j++) {
stack->witness_elements[j] = tal(stack,
struct witness_element);
stack->witness_element[j]->witness =
stack->witness_elements[j]->witness_data =
tal_dup_arr(stack, u8,
wtx_s->items[j].witness,
wtx_s->items[j].witness_len,