diff --git a/Cargo.toml b/Cargo.toml index 6996f59f0..a2f4f1984 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,17 +39,17 @@ default = [] #lightning-liquidity = { version = "0.2.0", features = ["std"] } #lightning-macros = { version = "0.2.0" } -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5", features = ["std"] } -lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5" } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5" } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5", features = ["tokio"] } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5" } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5" } -lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5", features = ["rest-client", "rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } -lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5", features = ["std"] } -lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5" } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774", features = ["std"] } +lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774" } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774" } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774", features = ["tokio"] } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774" } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774" } +lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774", features = ["rest-client", "rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } +lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774", features = ["std"] } +lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774" } bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] } bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]} @@ -78,13 +78,13 @@ log = { version = "0.4.22", default-features = false, features = ["std"]} vss-client = { package = "vss-client-ng", version = "0.4" } prost = { version = "0.11.6", default-features = false} #bitcoin-payment-instructions = { version = "0.6" } -bitcoin-payment-instructions = { git = "https://github.com/tnull/bitcoin-payment-instructions", rev = "6796e87525d6c564e1332354a808730e2ba2ebf8" } +bitcoin-payment-instructions = { git = "https://github.com/tnull/bitcoin-payment-instructions", rev = "b9f9991b42e9d71b3ca966818a93b158cf8f6c40" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "e9ce486a425933041b319ac72512227353310dc5", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "7fe3268475551b0664d315bfbc860416ca8fc774", features = ["std", "_test_utils"] } proptest = "1.0.0" regex = "1.5.6" criterion = { version = "0.7.0", features = ["async_tokio"] } diff --git a/src/builder.rs b/src/builder.rs index bedaba4b5..5d8a5a7a9 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -32,6 +32,7 @@ use lightning::routing::scoring::{ ProbabilisticScoringFeeParameters, }; use lightning::sign::{EntropySource, NodeSigner}; +use lightning::util::config::HTLCInterceptionFlags; use lightning::util::persist::{ KVStore, CHANNEL_MANAGER_PERSISTENCE_KEY, CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE, CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE, @@ -1434,7 +1435,7 @@ fn build_with_store_internal( if liquidity_source_config.and_then(|lsc| lsc.lsps2_service.as_ref()).is_some() { // If we act as an LSPS2 service, we need to be able to intercept HTLCs and forward the // information to the service handler. - user_config.accept_intercept_htlcs = true; + user_config.htlc_interception_flags = HTLCInterceptionFlags::ToInterceptSCIDs.into(); // If we act as an LSPS2 service, we allow forwarding to unannounced channels. user_config.accept_forwards_to_priv_channels = true; diff --git a/src/ffi/types.rs b/src/ffi/types.rs index f63a715e1..63870893f 100644 --- a/src/ffi/types.rs +++ b/src/ffi/types.rs @@ -1016,7 +1016,7 @@ impl Bolt11Invoice { /// Returns the hash to which we will receive the preimage on completion of the payment pub fn payment_hash(&self) -> PaymentHash { - PaymentHash(self.inner.payment_hash().to_byte_array()) + self.inner.payment_hash() } /// Get the payment secret if one was included in the invoice @@ -1434,10 +1434,7 @@ mod tests { let invoice_str = wrapped_invoice.to_string(); let parsed_invoice: LdkBolt11Invoice = invoice_str.parse().unwrap(); - assert_eq!( - ldk_invoice.payment_hash().to_byte_array().to_vec(), - parsed_invoice.payment_hash().to_byte_array().to_vec() - ); + assert_eq!(ldk_invoice.payment_hash(), parsed_invoice.payment_hash(),); } #[test] diff --git a/src/payment/bolt11.rs b/src/payment/bolt11.rs index 60c313381..41597bfcc 100644 --- a/src/payment/bolt11.rs +++ b/src/payment/bolt11.rs @@ -98,8 +98,8 @@ impl Bolt11Payment { } let invoice = maybe_deref(invoice); - let payment_hash = PaymentHash(invoice.payment_hash().to_byte_array()); - let payment_id = PaymentId(invoice.payment_hash().to_byte_array()); + let payment_hash = invoice.payment_hash(); + let payment_id = PaymentId(invoice.payment_hash().0); if let Some(payment) = self.payment_store.get(&payment_id) { if payment.status == PaymentStatus::Pending || payment.status == PaymentStatus::Succeeded @@ -204,8 +204,8 @@ impl Bolt11Payment { } } - let payment_hash = PaymentHash(invoice.payment_hash().to_byte_array()); - let payment_id = PaymentId(invoice.payment_hash().to_byte_array()); + let payment_hash = invoice.payment_hash(); + let payment_id = PaymentId(invoice.payment_hash().0); if let Some(payment) = self.payment_store.get(&payment_id) { if payment.status == PaymentStatus::Pending || payment.status == PaymentStatus::Succeeded @@ -494,7 +494,7 @@ impl Bolt11Payment { } }; - let payment_hash = PaymentHash(invoice.payment_hash().to_byte_array()); + let payment_hash = invoice.payment_hash(); let payment_secret = invoice.payment_secret(); let id = PaymentId(payment_hash.0); let preimage = if manual_claim_payment_hash.is_none() { @@ -712,7 +712,7 @@ impl Bolt11Payment { })?; // Register payment in payment store. - let payment_hash = PaymentHash(invoice.payment_hash().to_byte_array()); + let payment_hash = invoice.payment_hash(); let payment_secret = invoice.payment_secret(); let lsp_fee_limits = LSPFeeLimits { max_total_opening_fee_msat: lsp_total_opening_fee,