Commit a06ebee
committed
Stop enqueueing error messages for disconnected peers
If a channel is failed while a peer is disconnected, we'll still
have a `PeerState` for that peer. Historically, we haven't bothered
to check if a peer is actually connected before we push the `error`
message onto the `PeerState::pending_msg_events` queue, leaving us
sending messages into the void.
This is generally not an issue as
`ChannelManager::get_and_clear_pending_msg_events` should be called
very regularly, removing these messages and then dropping them as
`PeerManager` won't have anything to do with them. Further, when
the the message is an `error`, if a peer happens to connect between
when we push the message and when `get_and_clear_pending_msg_events`
is called the worst that happens is they get the `error` message
we'd end up sending them when they try to reestablish the channel
anyway.
Still, its awkward to leave the `error`s lying around in a message
queue for a disconnected peer, so we remove them here.1 parent 92e79ab commit a06ebee
File tree
6 files changed
+28
-16
lines changed- lightning/src/ln
6 files changed
+28
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3897 | 3897 | | |
3898 | 3898 | | |
3899 | 3899 | | |
3900 | | - | |
| 3900 | + | |
3901 | 3901 | | |
3902 | 3902 | | |
3903 | 3903 | | |
| |||
3914 | 3914 | | |
3915 | 3915 | | |
3916 | 3916 | | |
3917 | | - | |
| 3917 | + | |
3918 | 3918 | | |
3919 | 3919 | | |
3920 | 3920 | | |
| |||
4063 | 4063 | | |
4064 | 4064 | | |
4065 | 4065 | | |
4066 | | - | |
| 4066 | + | |
4067 | 4067 | | |
4068 | 4068 | | |
4069 | 4069 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3228 | 3228 | | |
3229 | 3229 | | |
3230 | 3230 | | |
3231 | | - | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
3232 | 3234 | | |
3233 | 3235 | | |
3234 | 3236 | | |
| |||
18808 | 18810 | | |
18809 | 18811 | | |
18810 | 18812 | | |
18811 | | - | |
| 18813 | + | |
18812 | 18814 | | |
18813 | 18815 | | |
18814 | 18816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8023 | 8023 | | |
8024 | 8024 | | |
8025 | 8025 | | |
8026 | | - | |
| 8026 | + | |
8027 | 8027 | | |
8028 | 8028 | | |
8029 | 8029 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3044 | 3044 | | |
3045 | 3045 | | |
3046 | 3046 | | |
3047 | | - | |
| 3047 | + | |
3048 | 3048 | | |
3049 | 3049 | | |
3050 | 3050 | | |
| |||
3407 | 3407 | | |
3408 | 3408 | | |
3409 | 3409 | | |
3410 | | - | |
| 3410 | + | |
3411 | 3411 | | |
3412 | 3412 | | |
3413 | 3413 | | |
| |||
3421 | 3421 | | |
3422 | 3422 | | |
3423 | 3423 | | |
3424 | | - | |
| 3424 | + | |
3425 | 3425 | | |
3426 | 3426 | | |
3427 | 3427 | | |
| |||
3618 | 3618 | | |
3619 | 3619 | | |
3620 | 3620 | | |
3621 | | - | |
| 3621 | + | |
3622 | 3622 | | |
3623 | 3623 | | |
3624 | 3624 | | |
| |||
3632 | 3632 | | |
3633 | 3633 | | |
3634 | 3634 | | |
3635 | | - | |
| 3635 | + | |
3636 | 3636 | | |
3637 | 3637 | | |
3638 | 3638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1287 | 1287 | | |
1288 | 1288 | | |
1289 | 1289 | | |
1290 | | - | |
| 1290 | + | |
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
328 | 338 | | |
329 | 339 | | |
330 | 340 | | |
| |||
387 | 397 | | |
388 | 398 | | |
389 | 399 | | |
390 | | - | |
| 400 | + | |
391 | 401 | | |
392 | 402 | | |
393 | 403 | | |
| |||
879 | 889 | | |
880 | 890 | | |
881 | 891 | | |
882 | | - | |
| 892 | + | |
883 | 893 | | |
884 | 894 | | |
885 | 895 | | |
| |||
1002 | 1012 | | |
1003 | 1013 | | |
1004 | 1014 | | |
1005 | | - | |
| 1015 | + | |
1006 | 1016 | | |
1007 | 1017 | | |
1008 | 1018 | | |
| |||
1015 | 1025 | | |
1016 | 1026 | | |
1017 | 1027 | | |
1018 | | - | |
| 1028 | + | |
1019 | 1029 | | |
1020 | 1030 | | |
1021 | 1031 | | |
| |||
0 commit comments