Handle claim result event generation in claim_funds_from_hop
authorMatt Corallo <git@bluematt.me>
Tue, 6 Dec 2022 21:01:50 +0000 (21:01 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 8 Dec 2022 21:24:26 +0000 (21:24 +0000)
commit1feb459811e283ab8fa1aa9c67e04a1e419cf710
tree89c026af8e490eb7f528bb795285613c9d7fa329
parentdef193d6bda4c46efddd13847612ceb58d040dc1
Handle claim result event generation in claim_funds_from_hop

Currently `claim_funds` and `claim_funds_internal` call
`claim_funds_from_hop` and then surface and `Event` to the user
informing them of the forwarded/claimed payment based on it's
result. In both places we assume that a claim "completed" even if
a monitor update is being done async.

Instead, here we push that event generation through a
`MonitorUpdateCompletionAction` and a call to
`handle_monitor_update_completion_action`. This will allow us to
hold the event(s) until async monitor updates complete in the
future.
lightning/src/ln/channelmanager.rs