use lightning::util::config::UserConfig;
use lightning::util::events::{Event, PaymentPurpose};
use lightning::util::ser::ReadableArgs;
-use lightning_background_processor::BackgroundProcessor;
+use lightning_background_processor::{BackgroundProcessor, GossipSync};
use lightning_block_sync::init;
use lightning_block_sync::poll;
use lightning_block_sync::SpvClient;
use lightning_invoice::utils::DefaultRouter;
use lightning_net_tokio::SocketDescriptor;
use lightning_persister::FilesystemPersister;
-use lightning_rapid_gossip_sync::RapidGossipSync;
use rand::{thread_rng, Rng};
use std::collections::hash_map::Entry;
use std::collections::HashMap;
type Router = DefaultRouter<Arc<NetworkGraph>, Arc<FilesystemLogger>>;
-type GossipSync<P, G, A, L> =
- lightning_background_processor::GossipSync<P, Arc<RapidGossipSync<G, L>>, G, A, L>;
-
pub(crate) type NetworkGraph = gossip::NetworkGraph<Arc<FilesystemLogger>>;
async fn handle_ldk_events(
}
Event::PaymentPathSuccessful { .. } => {}
Event::PaymentPathFailed { .. } => {}
+ Event::ProbeSuccessful { .. } => {}
+ Event::ProbeFailed { .. } => {}
Event::PaymentFailed { payment_hash, .. } => {
print!(
"\nEVENT: Failed to send payment to payment hash {:?}: exhausted payment retry attempts",
None => String::new(),
Some(channel) => {
match nodes.get(&NodeId::from_pubkey(&channel.counterparty.node_id)) {
- None => " from private node".to_string(),
+ None => "private node".to_string(),
Some(node) => match &node.announcement_info {
- None => " from unnamed node".to_string(),
+ None => "unnamed node".to_string(),
Some(announcement) => {
- format!(" from node {}", announcement.alias)
+ format!("node {}", announcement.alias)
}
},
}
.unwrap_or_default()
};
let from_prev_str =
- format!("{}{}", node_str(prev_channel_id), channel_str(prev_channel_id));
+ format!(" from {}{}", node_str(prev_channel_id), channel_str(prev_channel_id));
let to_next_str =
- format!("{}{}", node_str(next_channel_id), channel_str(next_channel_id));
+ format!(" to {}{}", node_str(next_channel_id), channel_str(next_channel_id));
let from_onchain_str = if *claim_from_onchain_tx {
"from onchain downstream claim"
print!("> ");
io::stdout().flush().unwrap();
}
+ Event::HTLCHandlingFailed { .. } => {}
Event::PendingHTLCsForwardable { time_forwardable } => {
let forwarding_channel_manager = channel_manager.clone();
let min = time_forwardable.as_millis() as u64;
invoice_payer.clone(),
chain_monitor.clone(),
channel_manager.clone(),
- GossipSync::P2P(gossip_sync.clone()),
+ GossipSync::p2p(gossip_sync.clone()),
peer_manager.clone(),
logger.clone(),
Some(scorer.clone()),