use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, Balance, MonitorEvent, TransactionOutputs, WithChannelMonitor};
use crate::chain::transaction::{OutPoint, TransactionData};
-use crate::ln::ChannelId;
+use crate::ln::types::ChannelId;
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::events;
use crate::events::{Event, EventHandler};
/// The best block height seen, used as a proxy for the passage of time.
highest_chain_height: AtomicUsize,
+ /// A [`Notifier`] used to wake up the background processor in case we have any [`Event`]s for
+ /// it to give to users (or [`MonitorEvent`]s for `ChannelManager` to process).
event_notifier: Notifier,
}
log_funding_info!(monitor)
),
ChannelMonitorUpdateStatus::InProgress => {
- log_debug!(logger, "Channel Monitor sync for channel {} in progress.", log_funding_info!(monitor));
+ log_trace!(logger, "Channel Monitor sync for channel {} in progress.", log_funding_info!(monitor));
},
ChannelMonitorUpdateStatus::UnrecoverableError => {
return Err(());
monitor.block_connected(
header, txdata, height, &*self.broadcaster, &*self.fee_estimator, &self.logger)
});
+ // Assume we may have some new events and wake the event processor
+ self.event_notifier.notify();
}
fn block_disconnected(&self, header: &Header, height: u32) {
monitor.transactions_confirmed(
header, txdata, height, &*self.broadcaster, &*self.fee_estimator, &self.logger)
});
+ // Assume we may have some new events and wake the event processor
+ self.event_notifier.notify();
}
fn transaction_unconfirmed(&self, txid: &Txid) {
header, height, &*self.broadcaster, &*self.fee_estimator, &self.logger
)
});
+ // Assume we may have some new events and wake the event processor
+ self.event_notifier.notify();
}
fn get_relevant_txids(&self) -> Vec<(Txid, u32, Option<BlockHash>)> {
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
create_announced_chan_between_nodes(&nodes, 0, 1);
- chanmon_cfgs[0].persister.chain_sync_monitor_persistences.lock().unwrap().clear();
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::UnrecoverableError);
assert!(std::panic::catch_unwind(|| {