| 1519 | } |
| 1520 | |
| 1521 | static void handle_tx_abort(struct state *state, u8 *msg) |
| 1522 | { |
| 1523 | const char *desc; |
| 1524 | |
| 1525 | /* |
| 1526 | * BOLT #2: |
| 1527 | * |
| 1528 | * Echoing back `tx_abort` allows the peer to ack |
| 1529 | * that they've seen the abort message, permitting |
| 1530 | * the originating peer to terminate the in-flight |
| 1531 | * process without worrying about stale messages. |
| 1532 | */ |
| 1533 | if (!state->aborted_err) { |
| 1534 | /* If they sent this after tx-sigs, it's a |
| 1535 | * protocol error */ |
| 1536 | if (state->tx_state->remote_funding_sigs_rcvd) |
| 1537 | open_err_fatal(state, "tx-abort rcvd after" |
| 1538 | " tx-sigs"); |
| 1539 | |
| 1540 | open_abort(state, "%s", "Rcvd tx-abort"); |
| 1541 | desc = tal_fmt(tmpctx, "They sent %s", |
| 1542 | sanitize_error(tmpctx, msg, NULL)); |
| 1543 | } else |
| 1544 | desc = state->aborted_err; |
| 1545 | |
| 1546 | negotiation_aborted(state, desc, true); |
| 1547 | } |
| 1548 | |
| 1549 | static u8 *handle_channel_ready(struct state *state, u8 *msg) |
| 1550 | { |
no test coverage detected