Commit b7ba29c
committed
Don't use
`Channel::is_pre_funded_state` is used to mean several different
things. In this case its used to decide if we should provide a
`ChannelMonitorUpdate` marking a channel as closed when we go to
force-close it.
Here, we want to capture exactly when the original `ChannelMonitor`
is first created, but were doing so indirectly by looking at the
channel's state. Worse, `is_pre_funded_state` got updated to be
false whenever there is an interctive signing session, which isn't
correct for this use - we may have an interactive signing session
but have already persisted the original `ChannelMonitor` when we
received the first `commitment_signed`.
Instead, we just move to examining
`counterparty_next_commitment_transaction_number` which is
decrementing for the first time at exactly the time we create the
original `ChannelMonitor`, so it provides a much simpler test.
Fixes #3880is_pre_funded_state to provide an FC monitor update1 parent 759d7aa commit b7ba29c
1 file changed
+7
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5496 | 5496 | | |
5497 | 5497 | | |
5498 | 5498 | | |
5499 | | - | |
5500 | | - | |
5501 | | - | |
5502 | | - | |
5503 | | - | |
5504 | | - | |
5505 | | - | |
5506 | | - | |
| 5499 | + | |
| 5500 | + | |
| 5501 | + | |
| 5502 | + | |
| 5503 | + | |
| 5504 | + | |
5507 | 5505 | | |
| 5506 | + | |
5508 | 5507 | | |
5509 | 5508 | | |
5510 | 5509 | | |
| |||
0 commit comments