@@ -236,11 +236,11 @@ impl<ChannelSigner: EcdsaChannelSigner> Deref for LockedChannelMonitor<'_, Chann
236236/// [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
237237pub struct ChainMonitor < ChannelSigner : EcdsaChannelSigner , C : Deref , T : Deref , F : Deref , L : Deref , P : Deref , ES : Deref >
238238 where C :: Target : chain:: Filter ,
239- T :: Target : BroadcasterInterface ,
240- F :: Target : FeeEstimator ,
241- L :: Target : Logger ,
242- P :: Target : Persist < ChannelSigner > ,
243- ES :: Target : EntropySource ,
239+ T :: Target : BroadcasterInterface ,
240+ F :: Target : FeeEstimator ,
241+ L :: Target : Logger ,
242+ P :: Target : Persist < ChannelSigner > ,
243+ ES :: Target : EntropySource ,
244244{
245245 monitors : RwLock < HashMap < ChannelId , MonitorHolder < ChannelSigner > > > ,
246246 chain_source : Option < C > ,
@@ -265,11 +265,11 @@ pub struct ChainMonitor<ChannelSigner: EcdsaChannelSigner, C: Deref, T: Deref, F
265265
266266impl < ChannelSigner : EcdsaChannelSigner , C : Deref , T : Deref , F : Deref , L : Deref , P : Deref , ES : Deref > ChainMonitor < ChannelSigner , C , T , F , L , P , ES >
267267where C :: Target : chain:: Filter ,
268- T :: Target : BroadcasterInterface ,
269- F :: Target : FeeEstimator ,
270- L :: Target : Logger ,
271- P :: Target : Persist < ChannelSigner > ,
272- ES :: Target : EntropySource ,
268+ T :: Target : BroadcasterInterface ,
269+ F :: Target : FeeEstimator ,
270+ L :: Target : Logger ,
271+ P :: Target : Persist < ChannelSigner > ,
272+ ES :: Target : EntropySource ,
273273{
274274 /// Dispatches to per-channel monitors, which are responsible for updating their on-chain view
275275 /// of a channel and reacting accordingly based on transactions in the given chain data. See
@@ -701,7 +701,10 @@ where C::Target: chain::Filter,
701701 fn send_peer_storage ( & self , their_node_id : PublicKey ) {
702702 // TODO: Serialize `ChannelMonitor`s inside `our_peer_storage`.
703703
704- let our_peer_storage = OurPeerStorage :: create_from_data ( self . our_peerstorage_encryption_key . clone ( ) , Vec :: new ( ) , self . entropy_source . get_secure_random_bytes ( ) ) ;
704+ let random_bytes = self . entropy_source . get_secure_random_bytes ( ) ;
705+ let peer_storage_key = self . our_peerstorage_encryption_key ;
706+ let serialised_channels = Vec :: new ( ) ;
707+ let our_peer_storage = OurPeerStorage :: create_from_data ( peer_storage_key, serialised_channels, random_bytes) ;
705708 log_debug ! ( self . logger, "Sending Peer Storage from chainmonitor" ) ;
706709 self . pending_send_only_events . lock ( ) . unwrap ( ) . push ( MessageSendEvent :: SendPeerStorage { node_id : their_node_id,
707710 msg : msgs:: PeerStorage { data : our_peer_storage. into_vec ( ) } } )
@@ -710,11 +713,11 @@ where C::Target: chain::Filter,
710713
711714impl < ChannelSigner : EcdsaChannelSigner , C : Deref , T : Deref , F : Deref , L : Deref , P : Deref , ES : Deref > BaseMessageHandler for ChainMonitor < ChannelSigner , C , T , F , L , P , ES >
712715where C :: Target : chain:: Filter ,
713- T :: Target : BroadcasterInterface ,
714- F :: Target : FeeEstimator ,
715- L :: Target : Logger ,
716- P :: Target : Persist < ChannelSigner > ,
717- ES :: Target : EntropySource ,
716+ T :: Target : BroadcasterInterface ,
717+ F :: Target : FeeEstimator ,
718+ L :: Target : Logger ,
719+ P :: Target : Persist < ChannelSigner > ,
720+ ES :: Target : EntropySource ,
718721{
719722 fn get_and_clear_pending_msg_events ( & self ) -> Vec < MessageSendEvent > {
720723 let mut pending_events = self . pending_send_only_events . lock ( ) . unwrap ( ) ;
@@ -834,11 +837,11 @@ where
834837impl < ChannelSigner : EcdsaChannelSigner , C : Deref , T : Deref , F : Deref , L : Deref , P : Deref , ES : Deref >
835838chain:: Watch < ChannelSigner > for ChainMonitor < ChannelSigner , C , T , F , L , P , ES >
836839where C :: Target : chain:: Filter ,
837- T :: Target : BroadcasterInterface ,
838- F :: Target : FeeEstimator ,
839- L :: Target : Logger ,
840- P :: Target : Persist < ChannelSigner > ,
841- ES :: Target : EntropySource ,
840+ T :: Target : BroadcasterInterface ,
841+ F :: Target : FeeEstimator ,
842+ L :: Target : Logger ,
843+ P :: Target : Persist < ChannelSigner > ,
844+ ES :: Target : EntropySource ,
842845{
843846 fn watch_channel ( & self , channel_id : ChannelId , monitor : ChannelMonitor < ChannelSigner > ) -> Result < ChannelMonitorUpdateStatus , ( ) > {
844847 let logger = WithChannelMonitor :: from ( & self . logger , & monitor, None ) ;
0 commit comments