mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-27 08:28:49 +01:00
- The ChainMonitor should: Whenever a new channel is added or updated, these updates should be conveyed to the persister and persisted to disk. Even if the update errors while it's being applied, the updated monitor still needs to be persisted.
14 lines
677 B
Rust
14 lines
677 B
Rust
use lightning::chain::channelmonitor;
|
|
use lightning::chain::transaction::OutPoint;
|
|
use lightning::util::enforcing_trait_impls::EnforcingChannelKeys;
|
|
|
|
pub struct TestPersister {}
|
|
impl channelmonitor::Persist<EnforcingChannelKeys> for TestPersister {
|
|
fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<EnforcingChannelKeys>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
|
|
Ok(())
|
|
}
|
|
|
|
fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: &channelmonitor::ChannelMonitorUpdate, _data: &channelmonitor::ChannelMonitor<EnforcingChannelKeys>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
|
|
Ok(())
|
|
}
|
|
}
|