From: Matt Corallo Date: Sun, 23 Apr 2023 17:12:40 +0000 (+0000) Subject: Update to LDK 0.0.115 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=bdc27445f9125c1c46d8a8b5d6b28dc290434492;p=ldk-sample Update to LDK 0.0.115 --- diff --git a/Cargo.toml b/Cargo.toml index 9e83e5f..9338251 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,13 +8,13 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -lightning = { version = "0.0.114", features = ["max_level_trace"] } -lightning-block-sync = { version = "0.0.114", features = [ "rpc-client" ] } -lightning-invoice = { version = "0.22" } -lightning-net-tokio = { version = "0.0.114" } -lightning-persister = { version = "0.0.114" } -lightning-background-processor = { version = "0.0.114" } -lightning-rapid-gossip-sync = { version = "0.0.114" } +lightning = { version = "0.0.115", features = ["max_level_trace"] } +lightning-block-sync = { version = "0.0.115", features = [ "rpc-client" ] } +lightning-invoice = { version = "0.23" } +lightning-net-tokio = { version = "0.0.115" } +lightning-persister = { version = "0.0.115" } +lightning-background-processor = { version = "0.0.115" } +lightning-rapid-gossip-sync = { version = "0.0.115" } base64 = "0.13.0" bitcoin = "0.29.0" diff --git a/src/cli.rs b/src/cli.rs index 96d5d9d..cba6255 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -9,7 +9,7 @@ use bitcoin::hashes::Hash; use bitcoin::network::constants::Network; use bitcoin::secp256k1::PublicKey; use lightning::chain::keysinterface::{EntropySource, KeysManager}; -use lightning::ln::channelmanager::{PaymentId, Retry}; +use lightning::ln::channelmanager::{PaymentId, RecipientOnionFields, Retry}; use lightning::ln::msgs::NetAddress; use lightning::ln::{PaymentHash, PaymentPreimage}; use lightning::onion_message::{CustomOnionMessageContents, Destination, OnionMessageContents}; @@ -703,6 +703,7 @@ fn keysend( }; let status = match channel_manager.send_spontaneous_payment_with_retry( Some(payment_preimage), + RecipientOnionFields::spontaneous_empty(), PaymentId(payment_hash.0), route_params, Retry::Timeout(Duration::from_secs(10)), diff --git a/src/main.rs b/src/main.rs index 9a5b625..6780d38 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,7 @@ use lightning::routing::gossip; use lightning::routing::gossip::{NodeId, P2PGossipSync}; use lightning::routing::router::DefaultRouter; use lightning::util::config::UserConfig; -use lightning::util::events::{Event, PaymentPurpose}; +use lightning::events::{Event, PaymentPurpose}; use lightning::util::ser::ReadableArgs; use lightning_background_processor::{BackgroundProcessor, GossipSync}; use lightning_block_sync::init; @@ -165,6 +165,8 @@ async fn handle_ldk_events( receiver_node_id: _, via_channel_id: _, via_user_channel_id: _, + claim_deadline: _, + onion_fields: _, } => { println!( "\nEVENT: received payment from payment hash {} of {} millisatoshis", @@ -260,6 +262,7 @@ async fn handle_ldk_events( next_channel_id, fee_earned_msat, claim_from_onchain_tx, + outbound_amount_forwarded_msat, } => { let read_only_network_graph = network_graph.read_only(); let nodes = read_only_network_graph.nodes(); @@ -297,15 +300,20 @@ async fn handle_ldk_events( } else { "from HTLC fulfill message" }; + let amt_args = if let Some(v) = outbound_amount_forwarded_msat { + format!("{}", v) + } else { + "?".to_string() + }; if let Some(fee_earned) = fee_earned_msat { println!( - "\nEVENT: Forwarded payment{}{}, earning {} msat {}", - from_prev_str, to_next_str, fee_earned, from_onchain_str + "\nEVENT: Forwarded payment for {} msat{}{}, earning {} msat {}", + amt_args, from_prev_str, to_next_str, fee_earned, from_onchain_str ); } else { println!( - "\nEVENT: Forwarded payment{}{}, claiming onchain {}", - from_prev_str, to_next_str, from_onchain_str + "\nEVENT: Forwarded payment for {} msat{}{}, claiming onchain {}", + amt_args, from_prev_str, to_next_str, from_onchain_str ); } print!("> "); @@ -337,6 +345,7 @@ async fn handle_ldk_events( .unwrap(); bitcoind_client.broadcast_transaction(&spending_tx); } + Event::ChannelPending { .. } => {} Event::ChannelReady { ref channel_id, user_channel_id: _,