Commit 8972f05
committed
Ack all monitor events besides HTLCUpdate
Currently, the resolution of HTLCs (and decisions on when HTLCs can be
forwarded) is the responsibility of Channel objects (a part of ChannelManager)
until the channel is closed, and then the ChannelMonitor thereafter. This leads
to some complexity around race conditions for HTLCs right around channel
closure. Additionally, there is lots of complexity reconstructing the state of
all HTLCs in the ChannelManager deserialization/loading logic.
Instead, we want to do all resolution in ChannelMonitors (in response to
ChannelMonitorUpdates) and pass them back to ChannelManager in the form of
MonitorEvents (similar to how HTLCs are resolved after channels are closed). In
order to have reliable resolution, we'll need to keep MonitorEvents around in
the ChannelMonitor until the ChannelManager has finished processing them. This
will simplify things - on restart instead of examining the set of HTLCs in
monitors we can simply replay all the pending MonitorEvents.
Here we take care of the monitor events that are trivial to ACK, since all
except HTLCEvents can be ACK'd immediately after the event is handled and don't
need to be re-processed on startup.1 parent 5de2515 commit 8972f05
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13267 | 13267 | | |
13268 | 13268 | | |
13269 | 13269 | | |
13270 | | - | |
| 13270 | + | |
| 13271 | + | |
13271 | 13272 | | |
13272 | 13273 | | |
13273 | 13274 | | |
| |||
13350 | 13351 | | |
13351 | 13352 | | |
13352 | 13353 | | |
| 13354 | + | |
| 13355 | + | |
| 13356 | + | |
13353 | 13357 | | |
13354 | 13358 | | |
13355 | 13359 | | |
| |||
13371 | 13375 | | |
13372 | 13376 | | |
13373 | 13377 | | |
| 13378 | + | |
| 13379 | + | |
| 13380 | + | |
13374 | 13381 | | |
13375 | 13382 | | |
13376 | 13383 | | |
13377 | 13384 | | |
13378 | 13385 | | |
13379 | 13386 | | |
13380 | 13387 | | |
| 13388 | + | |
13381 | 13389 | | |
13382 | 13390 | | |
13383 | 13391 | | |
| |||
0 commit comments