1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

bolt2: disallow sending multiple shutdown msg (#977)

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>
This commit is contained in:
Vincenzo Palazzo 2022-05-18 15:51:37 +02:00 committed by GitHub
parent 105c2e5e9f
commit e7017173d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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`.