diff --git a/channeld/Makefile b/channeld/Makefile index f71296fab..2d5ecd45b 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -70,6 +70,7 @@ CHANNELD_COMMON_OBJS := \ common/per_peer_state.o \ common/permute_tx.o \ common/ping.o \ + common/psbt_open.o \ common/pseudorand.o \ common/read_peer_msg.o \ common/setup.o \ diff --git a/closingd/Makefile b/closingd/Makefile index faa5c2c3b..6e9ee1417 100644 --- a/closingd/Makefile +++ b/closingd/Makefile @@ -46,6 +46,7 @@ CLOSINGD_COMMON_OBJS := \ common/peer_failed.o \ common/per_peer_state.o \ common/permute_tx.o \ + common/psbt_open.o \ common/pseudorand.o \ common/read_peer_msg.o \ common/setup.o \ diff --git a/connectd/Makefile b/connectd/Makefile index 27cec25bb..397558128 100644 --- a/connectd/Makefile +++ b/connectd/Makefile @@ -49,6 +49,7 @@ CONNECTD_COMMON_OBJS := \ common/node_id.o \ common/onionreply.o \ common/per_peer_state.o \ + common/psbt_open.o \ common/pseudorand.o \ common/setup.o \ common/status.o \ diff --git a/devtools/Makefile b/devtools/Makefile index 0034f393f..988eb8a06 100644 --- a/devtools/Makefile +++ b/devtools/Makefile @@ -33,6 +33,7 @@ DEVTOOLS_COMMON_OBJS := \ common/memleak.o \ common/node_id.o \ common/per_peer_state.o \ + common/psbt_open.o \ common/pseudorand.o \ common/json.o \ common/json_helpers.o \ diff --git a/gossipd/Makefile b/gossipd/Makefile index 8deed147f..c50a490d8 100644 --- a/gossipd/Makefile +++ b/gossipd/Makefile @@ -51,6 +51,7 @@ GOSSIPD_COMMON_OBJS := \ common/onionreply.o \ common/per_peer_state.o \ common/ping.o \ + common/psbt_open.o \ common/pseudorand.o \ common/random_select.o \ common/setup.o \ diff --git a/hsmd/Makefile b/hsmd/Makefile index e72ab99d5..9feab88c7 100644 --- a/hsmd/Makefile +++ b/hsmd/Makefile @@ -31,6 +31,7 @@ HSMD_COMMON_OBJS := \ common/msg_queue.o \ common/node_id.o \ common/permute_tx.o \ + common/psbt_open.o \ common/setup.o \ common/status.o \ common/status_wire.o \ diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index d19df9f77..8d76647bf 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -6,6 +6,7 @@ int unused_main(int argc, char *argv[]); #include "../lightningd.c" #include "../subd.c" #include +#include /* AUTOGENERATED MOCKS START */ /* Generated stub for activate_peers */ diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 61efe48e7..49660b73d 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -3,6 +3,7 @@ #include "../routehint.c" #include #include +#include bool deprecated_apis = false; diff --git a/lightningd/test/run-jsonrpc.c b/lightningd/test/run-jsonrpc.c index 19d95c540..10a2014fd 100644 --- a/lightningd/test/run-jsonrpc.c +++ b/lightningd/test/run-jsonrpc.c @@ -1,6 +1,7 @@ #include "../../common/json_stream.c" #include "../jsonrpc.c" #include "../json.c" +#include /* AUTOGENERATED MOCKS START */ /* Generated stub for db_begin_transaction_ */ diff --git a/lightningd/test/run-log-pruning.c b/lightningd/test/run-log-pruning.c index f55266ab3..9215412f6 100644 --- a/lightningd/test/run-log-pruning.c +++ b/lightningd/test/run-log-pruning.c @@ -1,4 +1,5 @@ #include "../log.c" +#include #include /* AUTOGENERATED MOCKS START */ diff --git a/onchaind/Makefile b/onchaind/Makefile index 1a9152dde..04cdefd66 100644 --- a/onchaind/Makefile +++ b/onchaind/Makefile @@ -53,6 +53,7 @@ ONCHAIND_COMMON_OBJS := \ common/onionreply.o \ common/peer_billboard.o \ common/permute_tx.o \ + common/psbt_open.o \ common/setup.o \ common/status.o \ common/status_wire.o \ diff --git a/wallet/reservation.c b/wallet/reservation.c index 45a553d88..e80fdcf9d 100644 --- a/wallet/reservation.c +++ b/wallet/reservation.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -141,6 +142,26 @@ static struct command_result *json_unreserveinputs(struct command *cmd, NULL)) return command_param_failed(); + /* We should also add the utxo info for these inputs! + * (absolutely required for using this psbt in a dual-funded + * round) */ + for (size_t i = 0; i < psbt->num_inputs; i++) { + struct bitcoin_tx *utxo_tx; + struct bitcoin_txid txid; + + wally_tx_input_get_txid(&psbt->tx->inputs[i], &txid); + utxo_tx = wallet_transaction_get(psbt, cmd->ld->wallet, + &txid); + if (utxo_tx) + wally_psbt_input_set_utxo(&psbt->inputs[i], + utxo_tx->wtx); + else + log_broken(cmd->ld->log, + "No transaction found for UTXO %s", + type_to_string(tmpctx, struct bitcoin_txid, + &txid)); + } + response = json_stream_success(cmd); json_array_start(response, "reservations"); for (size_t i = 0; i < psbt->tx->num_inputs; i++) {