From a7d4b8780eb6bdf3f23fe1c504ba61da35cfc39b Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 17 Sep 2020 18:31:39 -0500 Subject: [PATCH] elementsd: disable dual-funding test; don't add non-witness utxo Elementsd needs to be updated to v0.20.0 in order for this to work as expected --- tests/test_connection.py | 1 + wallet/reservation.c | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index 7dc8927e8..64d47380b 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -819,6 +819,7 @@ def test_funding_toolarge(node_factory, bitcoind): l1.rpc.fundchannel(l2.info['id'], amount) +@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') @unittest.skipIf(not EXPERIMENTAL_FEATURES, "dual-funding is experimental only") @unittest.skipIf(True, "df_opener.py requires wallycore") def test_v2_open(node_factory, bitcoind, chainparams): diff --git a/wallet/reservation.c b/wallet/reservation.c index 07df248b1..307bf6166 100644 --- a/wallet/reservation.c +++ b/wallet/reservation.c @@ -295,13 +295,19 @@ static struct wally_psbt *psbt_using_utxos(const tal_t *ctx, &asset); } - /* If we have the transaction for this utxo, - * add it to the PSBT as the non-witness-utxo field. - * Dual-funded channels and some hardware wallets - * require this */ - tx = wallet_transaction_get(ctx, wallet, &utxos[i]->txid); - if (tx) - psbt_input_set_utxo(psbt, i, tx->wtx); + /* FIXME: as of 17 sept 2020, elementsd is *at most* at par + * with v0.18.0 of bitcoind, which doesn't support setting + * non-witness and witness utxo data for an input; remove this + * check once elementsd can be updated */ + if (!is_elements(chainparams)) { + /* If we have the transaction for this utxo, + * add it to the PSBT as the non-witness-utxo field. + * Dual-funded channels and some hardware wallets + * require this */ + tx = wallet_transaction_get(ctx, wallet, &utxos[i]->txid); + if (tx) + psbt_input_set_utxo(psbt, i, tx->wtx); + } } return psbt;