check that all updates are being attempted to persist
authorValentine Wallace <vwallace@protonmail.com>
Wed, 17 Feb 2021 19:22:02 +0000 (14:22 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 17 Feb 2021 19:22:02 +0000 (14:22 -0500)
lightning-persister/src/lib.rs

index 4ec0b48b2a5bc97bec7c673daa046daf14e5ac5f..0febc0cef1ce8c8b0a85c4f89ae4c2ab1c771ded 100644 (file)
@@ -141,6 +141,7 @@ impl FilesystemPersister {
 
 impl<ChanSigner: ChannelKeys + Send + Sync> channelmonitor::Persist<ChanSigner> for FilesystemPersister {
        fn persist_new_channel(&self, funding_txo: OutPoint, monitor: &ChannelMonitor<ChanSigner>) -> Result<(), ChannelMonitorUpdateErr> {
+               println!("VMW: persisting monitor w/ update ID: {}", monitor.get_latest_update_id());
                let filename = format!("{}_{}", funding_txo.txid.to_hex(), funding_txo.index);
                util::write_to_file(self.path_to_channel_data.clone(), filename, monitor)
                  // .map_err(|_| ChannelMonitorUpdateErr::PermanentFailure)
@@ -151,6 +152,7 @@ impl<ChanSigner: ChannelKeys + Send + Sync> channelmonitor::Persist<ChanSigner>
        }
 
        fn update_persisted_channel(&self, funding_txo: OutPoint, _update: &ChannelMonitorUpdate, monitor: &ChannelMonitor<ChanSigner>) -> Result<(), ChannelMonitorUpdateErr> {
+               println!("VMW: updating persisted monitor w/ update ID: {}", monitor.get_latest_update_id());
                let filename = format!("{}_{}", funding_txo.txid.to_hex(), funding_txo.index);
                util::write_to_file(self.path_to_channel_data.clone(), filename, monitor)
                  // .map_err(|_| ChannelMonitorUpdateErr::PermanentFailure)