Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}
Expand Down Expand Up @@ -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"] }
Expand Down
3 changes: 2 additions & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 2 additions & 5 deletions src/ffi/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions src/payment/bolt11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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,
Expand Down
Loading