Skip to content
Closed
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 = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["std"] }
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["std"] }
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["tokio"] }
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["rest-client", "rpc-client", "tokio"] }
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["std"] }
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953", features = ["std"] }
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953" }
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953", features = ["std"] }
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953" }
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953", features = ["tokio"] }
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953" }
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953" }
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953", features = ["rest-client", "rpc-client", "tokio"] }
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953", features = ["std"] }
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953" }

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 @@ -79,13 +79,13 @@ async-trait = { version = "0.1", default-features = false }
vss-client = { package = "vss-client-ng", version = "0.5" }
prost = { version = "0.11.6", default-features = false}
#bitcoin-payment-instructions = { version = "0.6" }
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "0138feb7acefb1e49102a6fb46d7b776bf43265e" }
bitcoin-payment-instructions = { git = "https://github.com/joostjager/bitcoin-payment-instructions", rev = "7328bd3825887a02a99ce557368a4ba76adcbc0d" }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["winbase"] }

[dev-dependencies]
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["std", "_test_utils"] }
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "49912057895ddfbd69d503de67c80d5576c09953", features = ["std", "_test_utils"] }
rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] }
proptest = "1.0.0"
regex = "1.5.6"
Expand Down
1 change: 0 additions & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,6 @@ fn build_with_store_internal(
Arc::clone(&wallet),
Arc::clone(&channel_manager),
Arc::clone(&keys_manager),
Arc::clone(&chain_source),
Arc::clone(&tx_broadcaster),
Arc::clone(&kv_store),
Arc::clone(&config),
Expand Down
21 changes: 13 additions & 8 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1306,17 +1306,20 @@ where
}
},
LdkEvent::PaymentForwarded {
prev_channel_id,
next_channel_id,
prev_user_channel_id,
next_user_channel_id,
prev_node_id,
next_node_id,
prev_htlcs,
next_htlcs,
total_fee_earned_msat,
skimmed_fee_msat,
claim_from_onchain_tx,
outbound_amount_forwarded_msat,
} => {
let prev_channel_id = prev_htlcs.first().map(|h| h.channel_id);
let next_channel_id = next_htlcs.first().map(|h| h.channel_id);
let prev_user_channel_id = prev_htlcs.first().and_then(|h| h.user_channel_id);
let next_user_channel_id = next_htlcs.first().and_then(|h| h.user_channel_id);
let prev_node_id = prev_htlcs.first().and_then(|h| h.node_id);
let next_node_id = next_htlcs.first().and_then(|h| h.node_id);

{
let read_only_network_graph = self.network_graph.read_only();
let nodes = read_only_network_graph.nodes();
Expand Down Expand Up @@ -1384,8 +1387,10 @@ where
}

let event = Event::PaymentForwarded {
prev_channel_id: prev_channel_id.expect("prev_channel_id expected for events generated by LDK versions greater than 0.0.107."),
next_channel_id: next_channel_id.expect("next_channel_id expected for events generated by LDK versions greater than 0.0.107."),
prev_channel_id: prev_channel_id
.expect("prev_channel_id expected for PaymentForwarded events"),
next_channel_id: next_channel_id
.expect("next_channel_id expected for PaymentForwarded events"),
prev_user_channel_id: prev_user_channel_id.map(UserChannelId),
next_user_channel_id: next_user_channel_id.map(UserChannelId),
prev_node_id,
Expand Down
15 changes: 7 additions & 8 deletions src/liquidity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use lightning_types::payment::PaymentHash;
use tokio::sync::oneshot;

use crate::builder::BuildError;
use crate::chain::ChainSource;
use crate::connection::ConnectionManager;
use crate::logger::{log_debug, log_error, log_info, LdkLogger, Logger};
use crate::runtime::Runtime;
Expand Down Expand Up @@ -155,7 +154,6 @@ where
wallet: Arc<Wallet>,
channel_manager: Arc<ChannelManager>,
keys_manager: Arc<KeysManager>,
chain_source: Arc<ChainSource>,
tx_broadcaster: Arc<Broadcaster>,
kv_store: Arc<DynStore>,
config: Arc<Config>,
Expand All @@ -168,8 +166,7 @@ where
{
pub(crate) fn new(
wallet: Arc<Wallet>, channel_manager: Arc<ChannelManager>, keys_manager: Arc<KeysManager>,
chain_source: Arc<ChainSource>, tx_broadcaster: Arc<Broadcaster>, kv_store: Arc<DynStore>,
config: Arc<Config>, logger: L,
tx_broadcaster: Arc<Broadcaster>, kv_store: Arc<DynStore>, config: Arc<Config>, logger: L,
) -> Self {
let lsps1_client = None;
let lsps2_client = None;
Expand All @@ -181,7 +178,6 @@ where
wallet,
channel_manager,
keys_manager,
chain_source,
tx_broadcaster,
kv_store,
config,
Expand Down Expand Up @@ -239,7 +235,12 @@ where
let lsps2_service_config = Some(s.ldk_service_config.clone());
let lsps5_service_config = None;
let advertise_service = s.service_config.advertise_service;
LiquidityServiceConfig { lsps2_service_config, lsps5_service_config, advertise_service }
LiquidityServiceConfig {
lsps1_service_config: None,
lsps2_service_config,
lsps5_service_config,
advertise_service,
}
});

let lsps1_client_config = self.lsps1_client.as_ref().map(|s| s.ldk_client_config.clone());
Expand All @@ -256,8 +257,6 @@ where
Arc::clone(&self.keys_manager),
Arc::clone(&self.keys_manager),
Arc::clone(&self.channel_manager),
Some(Arc::clone(&self.chain_source)),
None,
Arc::clone(&self.kv_store),
Arc::clone(&self.tx_broadcaster),
liquidity_service_config,
Expand Down
5 changes: 5 additions & 0 deletions src/payment/unified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ impl UnifiedPayment {
PaymentMethod::LightningBolt12(_) => 0,
PaymentMethod::LightningBolt11(_) => 1,
PaymentMethod::OnChain(_) => 2,
PaymentMethod::Cashu(_) => 3,
});

for method in sorted_payment_methods {
Expand Down Expand Up @@ -282,6 +283,10 @@ impl UnifiedPayment {
let txid = self.onchain_payment.send_to_address(&address, amt_sats, None)?;
return Ok(UnifiedPaymentResult::Onchain { txid });
},
PaymentMethod::Cashu(_) => {
log_error!(self.logger, "Cashu payments are not supported.");
return Err(Error::PaymentSendingFailed);
},
}
}

Expand Down
1 change: 0 additions & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ pub(crate) type LiquidityManager = lightning_liquidity::LiquidityManager<
Arc<KeysManager>,
Arc<KeysManager>,
Arc<ChannelManager>,
Arc<ChainSource>,
Arc<DynStore>,
DefaultTimeProvider,
Arc<Broadcaster>,
Expand Down
Loading