Skip to content

Commit 9f27fcb

Browse files
authored
Merge pull request #291 from tnull/2024-05-upgrade-to-LDK-v0.0.123
Upgrade to LDK v0.0.123
2 parents 640a1fd + be43848 commit 9f27fcb

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

Cargo.toml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@ panic = 'abort' # Abort on panic
2828
default = []
2929

3030
[dependencies]
31-
lightning = { version = "0.0.123-beta", features = ["std"] }
32-
lightning-invoice = { version = "0.31.0-beta" }
33-
lightning-net-tokio = { version = "0.0.123-beta" }
34-
lightning-persister = { version = "0.0.123-beta" }
35-
lightning-background-processor = { version = "0.0.123-beta", features = ["futures"] }
36-
lightning-rapid-gossip-sync = { version = "0.0.123-beta" }
37-
lightning-transaction-sync = { version = "0.0.123-beta", features = ["esplora-async-https", "time"] }
38-
#lightning-liquidity = { version = "0.1.0-alpha.1", features = ["std"] }
39-
40-
lightning-liquidity = { git = "https://github.com/tnull/lightning-liquidity", rev = "abf7088c0e03221c0f122e797f34802c9e99a3d4", features = ["std"] }
31+
lightning = { version = "0.0.123", features = ["std"] }
32+
lightning-invoice = { version = "0.31.0" }
33+
lightning-net-tokio = { version = "0.0.123" }
34+
lightning-persister = { version = "0.0.123" }
35+
lightning-background-processor = { version = "0.0.123", features = ["futures"] }
36+
lightning-rapid-gossip-sync = { version = "0.0.123" }
37+
lightning-transaction-sync = { version = "0.0.123", features = ["esplora-async-https", "time"] }
38+
lightning-liquidity = { version = "0.1.0-alpha.4", features = ["std"] }
4139

4240
#lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main", features = ["std"] }
4341
#lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main" }
@@ -79,7 +77,7 @@ prost = { version = "0.11.6", default-features = false}
7977
winapi = { version = "0.3", features = ["winbase"] }
8078

8179
[dev-dependencies]
82-
lightning = { version = "0.0.123-beta", features = ["std", "_test_utils"] }
80+
lightning = { version = "0.0.123", features = ["std", "_test_utils"] }
8381
#lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main", features = ["std", "_test_utils"] }
8482
electrum-client = { version = "0.15.1", default-features = true }
8583
bitcoincore-rpc = { version = "0.17.0", default-features = false }

src/event.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,12 @@ where
706706
}
707707
},
708708
LdkEvent::SpendableOutputs { outputs, channel_id } => {
709-
self.output_sweeper.track_spendable_outputs(outputs, channel_id, true, None)
709+
self.output_sweeper
710+
.track_spendable_outputs(outputs, channel_id, true, None)
711+
.unwrap_or_else(|_| {
712+
log_error!(self.logger, "Failed to track spendable outputs");
713+
panic!("Failed to track spendable outputs");
714+
});
710715
},
711716
LdkEvent::OpenChannelRequest {
712717
temporary_channel_id,

src/io/utils.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,16 @@ where
263263
})?;
264264
let descriptors = vec![output.descriptor.clone()];
265265
let spend_delay = Some(best_block.height + 2);
266-
sweeper.track_spendable_outputs(descriptors, output.channel_id, true, spend_delay);
266+
sweeper
267+
.track_spendable_outputs(descriptors, output.channel_id, true, spend_delay)
268+
.map_err(|_| {
269+
log_error!(logger, "Failed to track spendable outputs. Aborting migration, will retry in the future.");
270+
std::io::Error::new(
271+
std::io::ErrorKind::InvalidData,
272+
"Failed to track spendable outputs. Aborting migration, will retry in the future.",
273+
)
274+
})?;
275+
267276
if let Some(tracked_spendable_output) =
268277
sweeper.tracked_spendable_outputs().iter().find(|o| o.descriptor == output.descriptor)
269278
{

tests/integration_tests_cln.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn test_cln() {
9494
let mut rng = thread_rng();
9595
let rand_label: String = (0..7).map(|_| rng.sample(Alphanumeric) as char).collect();
9696
let cln_invoice =
97-
cln_client.invoice(Some(2_500_000), &rand_label, &rand_label, None, None, None).unwrap();
97+
cln_client.invoice(Some(10_000_000), &rand_label, &rand_label, None, None, None).unwrap();
9898
let parsed_invoice = Bolt11Invoice::from_str(&cln_invoice.bolt11).unwrap();
9999

100100
node.send_payment(&parsed_invoice).unwrap();
@@ -106,7 +106,7 @@ fn test_cln() {
106106

107107
// Send a payment to LDK
108108
let rand_label: String = (0..7).map(|_| rng.sample(Alphanumeric) as char).collect();
109-
let ldk_invoice = node.receive_payment(2_500_000, &rand_label, 3600).unwrap();
109+
let ldk_invoice = node.receive_payment(10_000_000, &rand_label, 3600).unwrap();
110110
cln_client.pay(&ldk_invoice.to_string(), Default::default()).unwrap();
111111
common::expect_event!(node, PaymentReceived);
112112

0 commit comments

Comments
 (0)