Commit 4cd52cb
committed
Split out remaining uses of
`Channel::is_pre_funded_state` is used to mean several different
things. In the past few commits we stopped using it for a few
conflicting uses, but here we break out the remaining uses and
rename the remnants for clarity.
`is_funding_broadcast` was using `is_pre_funded_state` and was then
later used to decide if the `Channel` could be written to disk
(because it can be resumed on restart), if we should broadcast a
force-close transaction, and when to emit a `ChannelPending` event.
These were also somewhat divergent - we shouldn't generate a
`ChannelReady` event or broadcast a force-closing transaction until
we've actually broadcasted but want to write the `Channel` to disk
once we enter funding signature exchange for dual-funded open.
Thus, the ability to write a `Channel` to disk is provided by a new
`can_resume_on_restart` method. Then, `is_funding_broadcast` is
updated to only consider funding broadcasted after we provide our
funding signatures (i.e. the funding *could* have been
broadcasted). This is still a bit early to generate a
`ChannelPending` event (as the funding may not actually have been
broadcasted yet), but its better than it was.
Finally, the remaining `is_pre_funded_state` is renamed
`can_resume_on_reconnect`, which has slightly different semantics
than on-restart channels in batch opens.is_pre_funded_state and rename it1 parent b7ba29c commit 4cd52cb
2 files changed
+30
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
809 | | - | |
| 809 | + | |
810 | 810 | | |
811 | | - | |
812 | | - | |
813 | | - | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| |||
4001 | 4001 | | |
4002 | 4002 | | |
4003 | 4003 | | |
4004 | | - | |
| 4004 | + | |
4005 | 4005 | | |
4006 | 4006 | | |
4007 | 4007 | | |
| |||
4082 | 4082 | | |
4083 | 4083 | | |
4084 | 4084 | | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
| 4096 | + | |
| 4097 | + | |
4085 | 4098 | | |
4086 | 4099 | | |
4087 | | - | |
4088 | | - | |
4089 | | - | |
| 4100 | + | |
| 4101 | + | |
| 4102 | + | |
| 4103 | + | |
| 4104 | + | |
| 4105 | + | |
| 4106 | + | |
4090 | 4107 | | |
4091 | 4108 | | |
4092 | 4109 | | |
| |||
5432 | 5449 | | |
5433 | 5450 | | |
5434 | 5451 | | |
5435 | | - | |
| 5452 | + | |
5436 | 5453 | | |
5437 | 5454 | | |
5438 | 5455 | | |
| |||
8306 | 8323 | | |
8307 | 8324 | | |
8308 | 8325 | | |
8309 | | - | |
| 8326 | + | |
8310 | 8327 | | |
8311 | 8328 | | |
8312 | 8329 | | |
8313 | 8330 | | |
8314 | | - | |
| 8331 | + | |
8315 | 8332 | | |
8316 | 8333 | | |
8317 | 8334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15242 | 15242 | | |
15243 | 15243 | | |
15244 | 15244 | | |
15245 | | - | |
| 15245 | + | |
15246 | 15246 | | |
15247 | 15247 | | |
15248 | 15248 | | |
| |||
15254 | 15254 | | |
15255 | 15255 | | |
15256 | 15256 | | |
15257 | | - | |
| 15257 | + | |
15258 | 15258 | | |
15259 | 15259 | | |
15260 | 15260 | | |
| |||
0 commit comments