use crate::events;
use crate::events::bump_transaction::{WalletSource, Utxo};
use crate::ln::types::ChannelId;
-use crate::ln::channelmanager::{ChannelDetails, self};
+use crate::ln::channel_state::ChannelDetails;
+use crate::ln::channelmanager;
#[cfg(test)]
use crate::ln::chan_utils::CommitmentTransaction;
use crate::ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};
fn create_blinded_paths<
T: secp256k1::Signing + secp256k1::Verification
>(
- &self, recipient: PublicKey, peers: Vec<ForwardNode>, secp_ctx: &Secp256k1<T>,
+ &self, recipient: PublicKey, peers: Vec<PublicKey>, secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPath>, ()> {
self.router.create_blinded_paths(recipient, peers, secp_ctx)
}
+
+ fn create_compact_blinded_paths<
+ T: secp256k1::Signing + secp256k1::Verification
+ >(
+ &self, recipient: PublicKey, peers: Vec<ForwardNode>, secp_ctx: &Secp256k1<T>,
+ ) -> Result<Vec<BlindedPath>, ()> {
+ self.router.create_compact_blinded_paths(recipient, peers, secp_ctx)
+ }
}
impl<'a> Drop for TestRouter<'a> {
}
fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
- &self, recipient: PublicKey, peers: Vec<ForwardNode>, secp_ctx: &Secp256k1<T>,
+ &self, recipient: PublicKey, peers: Vec<PublicKey>, secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPath>, ()> {
self.inner.create_blinded_paths(recipient, peers, secp_ctx)
}
+
+ fn create_compact_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
+ &self, recipient: PublicKey, peers: Vec<ForwardNode>, secp_ctx: &Secp256k1<T>,
+ ) -> Result<Vec<BlindedPath>, ()> {
+ self.inner.create_compact_blinded_paths(recipient, peers, secp_ctx)
+ }
}
pub struct OnlyReadsKeysInterface {}
///
/// [`ChannelMonitor`]: channelmonitor::ChannelMonitor
pub offchain_monitor_updates: Mutex<HashMap<OutPoint, HashSet<u64>>>,
+ /// When we get an update_persisted_channel call with no ChannelMonitorUpdate, we insert the
+ /// monitor's funding outpoint here.
+ pub chain_sync_monitor_persistences: Mutex<VecDeque<OutPoint>>
}
impl TestPersister {
pub fn new() -> Self {
Self {
update_rets: Mutex::new(VecDeque::new()),
offchain_monitor_updates: Mutex::new(new_hash_map()),
+ chain_sync_monitor_persistences: Mutex::new(VecDeque::new())
}
}
ret = update_ret;
}
- if let Some(update) = update {
+ if let Some(update) = update {
self.offchain_monitor_updates.lock().unwrap().entry(funding_txo).or_insert(new_hash_set()).insert(update.update_id);
+ } else {
+ self.chain_sync_monitor_persistences.lock().unwrap().push_back(funding_txo);
}
ret
}
fn archive_persisted_channel(&self, funding_txo: OutPoint) {
- // remove the channel from the offchain_monitor_updates map
+ // remove the channel from the offchain_monitor_updates and chain_sync_monitor_persistences.
self.offchain_monitor_updates.lock().unwrap().remove(&funding_txo);
+ self.chain_sync_monitor_persistences.lock().unwrap().retain(|x| x != &funding_txo);
}
}