Ensure ChannelManager methods are idempotent
authorJeffrey Czyz <jkczyz@gmail.com>
Fri, 3 Dec 2021 19:04:58 +0000 (13:04 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 6 Dec 2021 23:18:33 +0000 (17:18 -0600)
commitc453d04137997f8ca2f79ae123b4915062e2f369
tree8348a267b2279a36ad8b1913687ede709bc48801
parenta3e4af0bb800a7fbc9d7908a41706d211eeda835
Ensure ChannelManager methods are idempotent

During event handling, ChannelManager methods may need to be called as
indicated in the Event documentation. Ensure that these calls are
idempotent for the same event rather than panicking. This allows users
to persist events for later handling without needing to worry about
processing the same event twice (e.g., if ChannelManager is not
persisted but the events were, the restarted ChannelManager would return
some of the same events).
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/util/events.rs