From: Matt Corallo Date: Mon, 7 Mar 2022 18:41:07 +0000 (+0000) Subject: Update to 0.0.105 upstream API X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=8c544c0c2acbd870331bd72754166486b3057207;p=ldk-sample Update to 0.0.105 upstream API --- diff --git a/Cargo.toml b/Cargo.toml index 6a1546a..8e3fe5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,12 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -lightning = { version = "0.0.104", features = ["max_level_trace"] } -lightning-block-sync = { version = "0.0.104", features = [ "rpc-client" ] } -lightning-invoice = { version = "0.12.0" } -lightning-net-tokio = { version = "0.0.104" } -lightning-persister = { version = "0.0.104" } -lightning-background-processor = { version = "0.0.104" } +lightning = { version = "0.0.105", features = ["max_level_trace"] } +lightning-block-sync = { version = "0.0.105", features = [ "rpc-client" ] } +lightning-invoice = { version = "0.13" } +lightning-net-tokio = { version = "0.0.105" } +lightning-persister = { version = "0.0.105" } +lightning-background-processor = { version = "0.0.105" } base64 = "0.13.0" bitcoin = "0.27" @@ -25,7 +25,7 @@ futures = "0.3" chrono = "0.4" rand = "0.4" serde_json = { version = "1.0" } -tokio = { version = "1.5", features = [ "io-util", "macros", "rt", "rt-multi-thread", "sync", "net", "time" ] } +tokio = { version = "1", features = [ "io-util", "macros", "rt", "rt-multi-thread", "sync", "net", "time" ] } [profile.release] panic = "abort" diff --git a/src/cli.rs b/src/cli.rs index a167027..c7dffd2 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -8,7 +8,7 @@ use bitcoin::hashes::sha256::Hash as Sha256; use bitcoin::hashes::Hash; use bitcoin::network::constants::Network; use bitcoin::secp256k1::key::PublicKey; -use lightning::chain::keysinterface::{KeysInterface, KeysManager}; +use lightning::chain::keysinterface::{KeysInterface, KeysManager, Recipient}; use lightning::ln::msgs::NetAddress; use lightning::ln::{PaymentHash, PaymentPreimage}; use lightning::util::config::{ChannelConfig, ChannelHandshakeLimits, UserConfig}; @@ -355,7 +355,7 @@ pub(crate) async fn poll_for_user_input( "{:?}", lightning::util::message_signing::sign( &line.as_bytes()[MSG_STARTPOS..], - &keys_manager.get_node_secret() + &keys_manager.get_node_secret(Recipient::Node).unwrap() ) ); } diff --git a/src/main.rs b/src/main.rs index 0e18bc0..a974b76 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ use bitcoin_bech32::WitnessProgram; use lightning::chain; use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator}; use lightning::chain::chainmonitor; -use lightning::chain::keysinterface::{InMemorySigner, KeysInterface, KeysManager}; +use lightning::chain::keysinterface::{InMemorySigner, KeysInterface, KeysManager, Recipient}; use lightning::chain::{BestBlock, Filter, Watch}; use lightning::ln::channelmanager; use lightning::ln::channelmanager::{ @@ -218,6 +218,9 @@ async fn handle_ldk_events( } } } + Event::OpenChannelRequest { .. } => { + // Unreachable, we don't set manually_accept_inbound_channels + } Event::PaymentPathSuccessful { .. } => {} Event::PaymentPathFailed { .. } => {} Event::PaymentFailed { payment_hash, .. } => { @@ -397,7 +400,7 @@ async fn start_ldk() { let mut user_config = UserConfig::default(); user_config.peer_channel_config_limits.force_announced_channel_preference = false; let mut restarting_node = true; - let (channel_manager_blockhash, mut channel_manager) = { + let (channel_manager_blockhash, channel_manager) = { if let Ok(mut f) = fs::File::open(format!("{}/manager", ldk_data_dir.clone())) { let mut channel_monitor_mut_references = Vec::new(); for (_, channel_monitor) in channelmonitors.iter_mut() { @@ -444,7 +447,7 @@ async fn start_ldk() { let mut chain_tip: Option = None; if restarting_node { let mut chain_listeners = - vec![(channel_manager_blockhash, &mut channel_manager as &mut dyn chain::Listen)]; + vec![(channel_manager_blockhash, &channel_manager as &dyn chain::Listen)]; for (blockhash, channel_monitor) in channelmonitors.drain(..) { let outpoint = channel_monitor.get_funding_txo().0; @@ -456,10 +459,8 @@ async fn start_ldk() { } for monitor_listener_info in chain_listener_channel_monitors.iter_mut() { - chain_listeners.push(( - monitor_listener_info.0, - &mut monitor_listener_info.1 as &mut dyn chain::Listen, - )); + chain_listeners + .push((monitor_listener_info.0, &monitor_listener_info.1 as &dyn chain::Listen)); } chain_tip = Some( init::synchronize_listeners( @@ -516,7 +517,7 @@ async fn start_ldk() { }; let peer_manager: Arc = Arc::new(PeerManager::new( lightning_msg_handler, - keys_manager.get_node_secret(), + keys_manager.get_node_secret(Recipient::Node).unwrap(), &ephemeral_bytes, logger.clone(), Arc::new(IgnoringMessageHandler {}),