Commit 4582b20
committed
Avoid startup
If a peer creates a channel with us which never reaches the funding
stage (or never gets any commitment updates after creation), we'll
avoid inserting the `update_id` into
`closed_channel_monitor_update_ids` at runtime to avoid keeping a
`PeerState` entry around for no reason. However, on startup we
still create a `ChannelMonitorUpdate` with a `ChannelForceClosed`
update step to ensure the `ChannelMonitor` is locked and shut down.
This is pretty redundant, and results in a bunch of on-startup
`ChannelMonitorUpdate`s for any old but non-archived
`ChannelMonitor`s. Instead, here, we check if a `ChannelMonitor`
already saw a `ChannelForceClosed` update step before we generate
the on-startup `ChannelMonitorUpdate`.
This also allows us to skip the `closed_channel_monitor_update_ids`
insertion as we can be confident we'll never have a
`ChannelMonitorUpdate` for this channel at all.PeerState entries for peers with unfunded channels1 parent c99d3d7 commit 4582b20
File tree
4 files changed
+28
-72
lines changed- lightning/src
- chain
- ln
4 files changed
+28
-72
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1711 | 1711 | | |
1712 | 1712 | | |
1713 | 1713 | | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
1714 | 1720 | | |
1715 | 1721 | | |
1716 | 1722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7253 | 7253 | | |
7254 | 7254 | | |
7255 | 7255 | | |
7256 | | - | |
7257 | | - | |
7258 | 7256 | | |
7259 | 7257 | | |
7260 | 7258 | | |
| |||
7279 | 7277 | | |
7280 | 7278 | | |
7281 | 7279 | | |
7282 | | - | |
7283 | | - | |
7284 | | - | |
7285 | | - | |
7286 | | - | |
7287 | | - | |
7288 | | - | |
7289 | | - | |
7290 | | - | |
7291 | | - | |
7292 | | - | |
7293 | | - | |
7294 | | - | |
7295 | | - | |
7296 | | - | |
7297 | | - | |
7298 | | - | |
7299 | | - | |
7300 | | - | |
7301 | | - | |
7302 | | - | |
7303 | | - | |
7304 | | - | |
7305 | | - | |
7306 | | - | |
7307 | | - | |
7308 | | - | |
7309 | | - | |
7310 | | - | |
7311 | | - | |
7312 | | - | |
7313 | | - | |
7314 | | - | |
7315 | | - | |
7316 | | - | |
7317 | | - | |
7318 | | - | |
7319 | | - | |
7320 | | - | |
7321 | | - | |
7322 | | - | |
7323 | | - | |
7324 | | - | |
7325 | | - | |
7326 | | - | |
7327 | | - | |
7328 | | - | |
7329 | | - | |
7330 | | - | |
7331 | | - | |
7332 | | - | |
7333 | | - | |
7334 | | - | |
7335 | | - | |
7336 | | - | |
7337 | 7280 | | |
7338 | 7281 | | |
7339 | 7282 | | |
| |||
12632 | 12575 | | |
12633 | 12576 | | |
12634 | 12577 | | |
| 12578 | + | |
| 12579 | + | |
| 12580 | + | |
| 12581 | + | |
| 12582 | + | |
| 12583 | + | |
| 12584 | + | |
| 12585 | + | |
| 12586 | + | |
| 12587 | + | |
| 12588 | + | |
| 12589 | + | |
| 12590 | + | |
| 12591 | + | |
| 12592 | + | |
| 12593 | + | |
| 12594 | + | |
| 12595 | + | |
| 12596 | + | |
| 12597 | + | |
| 12598 | + | |
| 12599 | + | |
12635 | 12600 | | |
12636 | 12601 | | |
12637 | 12602 | | |
| |||
12650 | 12615 | | |
12651 | 12616 | | |
12652 | 12617 | | |
12653 | | - | |
12654 | | - | |
12655 | | - | |
12656 | | - | |
12657 | | - | |
12658 | | - | |
12659 | | - | |
12660 | 12618 | | |
12661 | 12619 | | |
12662 | 12620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2302 | 2302 | | |
2303 | 2303 | | |
2304 | 2304 | | |
2305 | | - | |
2306 | | - | |
2307 | | - | |
2308 | 2305 | | |
2309 | 2306 | | |
2310 | 2307 | | |
| |||
3014 | 3011 | | |
3015 | 3012 | | |
3016 | 3013 | | |
3017 | | - | |
3018 | 3014 | | |
3019 | 3015 | | |
3020 | 3016 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
997 | 996 | | |
998 | 997 | | |
999 | 998 | | |
| |||
1023 | 1022 | | |
1024 | 1023 | | |
1025 | 1024 | | |
1026 | | - | |
1027 | 1025 | | |
1028 | 1026 | | |
1029 | 1027 | | |
| |||
1162 | 1160 | | |
1163 | 1161 | | |
1164 | 1162 | | |
1165 | | - | |
1166 | 1163 | | |
1167 | 1164 | | |
1168 | 1165 | | |
| |||
3522 | 3519 | | |
3523 | 3520 | | |
3524 | 3521 | | |
3525 | | - | |
3526 | 3522 | | |
3527 | 3523 | | |
3528 | 3524 | | |
| |||
0 commit comments