diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 5a2311874743..b26b8544b2c6 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -1252,6 +1252,7 @@ static char *do_commit_signed_received(const tal_t *ctx, tx_state->psbt)); } + tx_state->has_commitments = true; return NULL; } @@ -1345,6 +1346,11 @@ static void handle_tx_sigs(struct state *state, const u8 *msg) struct bitcoin_txid, &tx_state->funding.txid)); + if (!tx_state->has_commitments) + open_err_fatal(state, + "tx_signatures sent before commitment sigs %s", + tal_hex(msg, msg)); + /* We put the PSBT + sigs all together */ for (size_t i = 0, j = 0; i < tx_state->psbt->num_inputs; i++) { struct wally_psbt_input *in = diff --git a/tests/test_opening.py b/tests/test_opening.py index a8475c61fa78..0508f68829e3 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -217,7 +217,6 @@ def test_v2_open_sigs_reconnect_1(node_factory, bitcoind): @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') -@pytest.mark.xfail @pytest.mark.openchannel('v2') def test_v2_open_sigs_out_of_order(node_factory, bitcoind): """ Test what happens if the tx-sigs get sent "before" commitment signed """