Pass along ChannelManager's last_block_hash
authorJeffrey Czyz <jkczyz@gmail.com>
Fri, 5 Mar 2021 02:22:37 +0000 (18:22 -0800)
committerJeffrey Czyz <jkczyz@gmail.com>
Fri, 5 Mar 2021 23:45:12 +0000 (15:45 -0800)
commit31093adef83223494f4fc93c26d91d4bc365bdba
treea8ef72d7411d8b8d27fdff49d3d93ddc3f628d2f
parentcaabc4ef39233a78a9b88787719c653f76c31d1d
Pass along ChannelManager's last_block_hash

ChannelMonitor keeps track of the last block connected. However, it is
initialized with the default block hash, which is a problem if the
ChannelMonitor is serialized before a block is connected. Instead, pass
ChannelManager's last_block_hash, which is initialized with a "birthday"
hash, when creating a new ChannelMonitor.
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs