Skip to content

Commit

Permalink
bolt2: disallow sending multiple shutdown msg
Browse files Browse the repository at this point in the history
This is a second proposal different from lightning#976 where it is not allowed to send multiple shutdown messages from the receiver viewpoint.

The rationale for this is to avoid bad cases like the following one that is permitted by the spec

```
     ____________________________________________
    | sender -> shutdown(script_one) -> receiver |
    | sender -> shutdown(script_two) -> receiver |
    | sender <- shutdown(script_one) <- receiver |
     --------------------------------------------
```

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
  • Loading branch information
vincenzopalazzo committed May 18, 2022
1 parent e60d594 commit 73bbb56
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions 02-peer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ A sending node:
- MAY send a `shutdown` before a `funding_locked`, i.e. before the funding transaction has reached `minimum_depth`.
- if there are updates pending on the receiving node's commitment transaction:
- MUST NOT send a `shutdown`.
- MUST NOT send multiple `shutdown` messages.
- MUST NOT send an `update_add_htlc` after a `shutdown`.
- if no HTLCs remain in either commitment transaction:
- MUST NOT send any `update` message after a `shutdown`.
Expand Down

0 comments on commit 73bbb56

Please sign in to comment.