]> git.bitcoin.ninja Git - ldk-sample/commitdiff
Update to latest upstream rust-lightning, bumping deps
authorMatt Corallo <git@bluematt.me>
Fri, 13 Aug 2021 19:26:57 +0000 (19:26 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 13 Aug 2021 19:31:07 +0000 (19:31 +0000)
Cargo.toml
src/main.rs

index 414d3386492a9b38bf1a2fb38721ff15b1b1ce76..e71926de14a8c893fc91e44d399ea45e747bcb4b 100644 (file)
@@ -16,9 +16,9 @@ lightning-persister = { version = "0.0.99", git = "https://github.com/rust-bitco
 lightning-background-processor = { version = "0.0.99", git = "https://github.com/rust-bitcoin/rust-lightning", branch = "main" }
 
 base64 = "0.13.0"
-bitcoin = "0.26"
-bitcoin-bech32 = "0.7"
-bech32 = "0.7"
+bitcoin = "0.27"
+bitcoin-bech32 = "0.12"
+bech32 = "0.8"
 hex = "0.3"
 
 futures = "0.3"
index 57f0bb2ea7f9017c42feb5b6ef7b9b8818bbda7d..0229873380b6f06dfde5885dca4b4915ac2a6975 100644 (file)
@@ -224,6 +224,23 @@ async fn handle_ldk_events(
                                payment.status = HTLCStatus::Failed;
                        }
                }
+               Event::PaymentForwarded { fee_earned_msat, claim_from_onchain_tx } => {
+                       let from_onchain_str = if claim_from_onchain_tx {
+                               "from onchain downstream claim"
+                       } else {
+                               "from HTLC fulfill message"
+                       };
+                       if let Some(fee_earned) = fee_earned_msat {
+                               println!(
+                                       "\nEVENT: Forwarded payment, earning {} msat {}",
+                                       fee_earned, from_onchain_str
+                               );
+                       } else {
+                               println!("\nEVENT: Forwarded payment, claiming onchain {}", from_onchain_str);
+                       }
+                       print!("> ");
+                       io::stdout().flush().unwrap();
+               }
                Event::PendingHTLCsForwardable { time_forwardable } => {
                        let forwarding_channel_manager = channel_manager.clone();
                        tokio::spawn(async move {