Skip to content

Commit

Permalink
bolt2: disallow sending multiple shutdown msg (#977)
Browse files Browse the repository at this point in the history
The rationale for this is to avoid bad cases like the following one
which was previously allowed:

* 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 authored May 18, 2022
1 parent 105c2e5 commit e701717
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 @@ -546,6 +546,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 e701717

Please sign in to comment.