|
8 | 8 | * commit to the database once openingd succeeds. |
9 | 9 | */ |
10 | 10 | #include "config.h" |
| 11 | +#include <assert.h> |
11 | 12 | #include <bitcoin/script.h> |
12 | 13 | #include <ccan/array_size/array_size.h> |
13 | 14 | #include <ccan/breakpoint/breakpoint.h> |
|
31 | 32 | #include <openingd/openingd_wiregen.h> |
32 | 33 | #include <wire/peer_wire.h> |
33 | 34 | #include <wire/wire_sync.h> |
| 35 | +#include <wally_psbt.h> |
34 | 36 |
|
35 | 37 | /* stdin == lightningd, 3 == peer, 4 = hsmd */ |
36 | 38 | #define REQ_FD STDIN_FILENO |
@@ -703,13 +705,15 @@ static bool funder_finalize_channel_setup(struct state *state, |
703 | 705 | else |
704 | 706 | *pbase = NULL; |
705 | 707 |
|
| 708 | + assert((*tx)->psbt->inputs[0].witness_utxo); |
706 | 709 | msg = towire_openingd_on_funding_tx(tmpctx, *tx, &cid); |
707 | 710 | wire_sync_write(REQ_FD, msg); |
708 | 711 | msg = wire_sync_read(tmpctx, REQ_FD); |
709 | 712 | if (!fromwire_openingd_on_funding_tx_reply(msg, msg, tx)) |
710 | 713 | status_failed(STATUS_FAIL_MASTER_IO, "Bad onfunding_tx %s", |
711 | 714 | tal_hex(tmpctx, msg)); |
712 | 715 |
|
| 716 | + assert((*tx)->psbt->inputs[0].witness_utxo); |
713 | 717 | /* We ask the HSM to sign their commitment transaction for us: it knows |
714 | 718 | * our funding key, it just needs the remote funding key to create the |
715 | 719 | * witness script. It also needs the amount of the funding output, |
|
0 commit comments