]> git.bitcoin.ninja Git - rust-lightning/commit
Avoid persisting a ChannelManager update after each timer tick
authorMatt Corallo <git@bluematt.me>
Fri, 7 May 2021 22:16:47 +0000 (22:16 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 14 May 2021 23:20:27 +0000 (23:20 +0000)
commit316f01a42fb5cfcb0c897eaa48613fa544c4ec0a
tree78b307cb4814223f340fabc641f659c6f11db163
parent1dd9a4df88766ada65b350400ebf6a62702f066c
Avoid persisting a ChannelManager update after each timer tick

Currently, when a user calls `ChannelManager::timer_tick_occurred`
we always set the persister's update flag to true. This results in
a ChannelManager persistence after each timer tick, even when
nothing happened.

Instead, we add a new flag to `PersistenceNotifierGuard` to
indicate if we should skip setting the update flag.
lightning/src/ln/channelmanager.rs