]> git.bitcoin.ninja Git - ldk-sample/commitdiff
Update to LDK 0.0.115
authorMatt Corallo <git@bluematt.me>
Sun, 23 Apr 2023 17:12:40 +0000 (17:12 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 25 Apr 2023 06:25:42 +0000 (06:25 +0000)
Cargo.toml
src/cli.rs
src/main.rs

index 9e83e5f5ff46d4aa5b02d2b480452bd83343799d..93382511f7f1b142da42544f4d25b8d88b6fdf70 100644 (file)
@@ -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"
index 96d5d9d3c137eaabf97358d17d1d676a1dbdef87..cba62559166d02a35b95e1356a720de947711eaa 100644 (file)
@@ -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<E: EntropySource>(
        };
        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)),
index 9a5b62584b7383374bda67b6db322ae46dfe2248..6780d38d59dd3d793ab72a2aed4bdb36c5c9e383 100644 (file)
@@ -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: _,