mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
dualfund, tx-abort: only check for abort state if we're sending
In the case where you're echoing back a tx-abort, just let it through. Not doing this causes problems in the case where your node has forgotten about an in-progress open. This fixes the following problem: - you send a tx-abort (even tho you have marked tx-sigs as received) - peer echos it back (we echo back tx-aborts always) - you throw an error because you're already in a tx-abort unallowed state In this commit, we allow for echos to come thru no matter our current state and this fixes things/makes them work as expected.
This commit is contained in:
parent
979276386a
commit
b2d2796aad
@ -1489,12 +1489,6 @@ static void handle_tx_abort(struct state *state, u8 *msg)
|
||||
{
|
||||
const char *desc;
|
||||
|
||||
/* If they sent this after tx-sigs, it's a
|
||||
* protocol error */
|
||||
if (state->tx_state->remote_funding_sigs_rcvd)
|
||||
open_err_fatal(state, "tx-abort rcvd after"
|
||||
" tx-sigs");
|
||||
|
||||
/*
|
||||
* BOLT-07cc0edc791aff78398a48fc31ee23b45374d8d9 #2:
|
||||
*
|
||||
@ -1504,6 +1498,12 @@ static void handle_tx_abort(struct state *state, u8 *msg)
|
||||
* process without worrying about stale messages.
|
||||
*/
|
||||
if (!state->aborted_err) {
|
||||
/* If they sent this after tx-sigs, it's a
|
||||
* protocol error */
|
||||
if (state->tx_state->remote_funding_sigs_rcvd)
|
||||
open_err_fatal(state, "tx-abort rcvd after"
|
||||
" tx-sigs");
|
||||
|
||||
open_abort(state, "%s", "Rcvd tx-abort");
|
||||
desc = tal_fmt(tmpctx, "They sent %s",
|
||||
sanitize_error(tmpctx, msg, NULL));
|
||||
|
Loading…
Reference in New Issue
Block a user