]> git.bitcoin.ninja Git - rust-lightning/commit
Give ChannelManagerReadArgs HashMap-of-monitors ownership
authorMatt Corallo <git@bluematt.me>
Fri, 7 Aug 2020 20:27:26 +0000 (16:27 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 26 Aug 2020 01:26:48 +0000 (21:26 -0400)
commit2ff4ae782eccb84e09f86e7d37c426e6153ea961
treef1243eb785d679edf8b9037f883b9d08d9d545d6
parent6df9129ace609bfb5c7f08ae0f41175126d05b1b
Give ChannelManagerReadArgs HashMap-of-monitors ownership

Its somewhat awkward that ChannelManagerReadArgs requires a mutable
reference to a HashMap of ChannelMonitors, forcing the callsite to
define a scope for the HashMap which they almost certainly won't use
after deserializing the ChannelManager. Worse, to map the current
version to C bindings, we'd need to also create a HashMap binding,
which is overkill for just this one use.

Instead, we just give the ReadArgs struct ownership of the HashMap
and add a constructor which fills the HashMap for you.
fuzz/src/chanmon_consistency.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs