Skip to content

Commit 7ad0d63

Browse files
authored
Merge pull request #806 from jkczyz/2026-02-splicing-events
Bump LDK dependency for `RecipientOnionFields` and `SpliceFailed` changes
2 parents 3742391 + 52c3616 commit 7ad0d63

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ default = []
3939
#lightning-liquidity = { version = "0.2.0", features = ["std"] }
4040
#lightning-macros = { version = "0.2.0" }
4141

42-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a", features = ["std"] }
43-
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a" }
44-
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a", features = ["std"] }
45-
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a" }
46-
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a", features = ["tokio"] }
47-
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a" }
48-
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a" }
49-
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a", features = ["rest-client", "rpc-client", "tokio"] }
50-
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
51-
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a", features = ["std"] }
52-
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a" }
42+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
43+
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
44+
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
45+
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
46+
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["tokio"] }
47+
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
48+
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
49+
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["rest-client", "rpc-client", "tokio"] }
50+
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
51+
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
52+
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
5353

5454
bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] }
5555
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"]}
7878
vss-client = { package = "vss-client-ng", version = "0.5" }
7979
prost = { version = "0.11.6", default-features = false}
8080
#bitcoin-payment-instructions = { version = "0.6" }
81-
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "8fbb1997917c9a5687f8e532cab9a453af3c3dc1" }
81+
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "869fd348c3ca0c78f439d2f31181f4d798c6b20e" }
8282

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

8686
[dev-dependencies]
87-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "2d2151a4e40734b871289e8bb0fa13466c0ea60a", features = ["std", "_test_utils"] }
87+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std", "_test_utils"] }
8888
rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] }
8989
proptest = "1.0.0"
9090
regex = "1.5.6"

src/event.rs

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ use bitcoin::secp256k1::PublicKey;
1616
use bitcoin::{Amount, OutPoint};
1717
use lightning::events::bump_transaction::BumpTransactionEvent;
1818
use lightning::events::{
19-
ClosureReason, Event as LdkEvent, PaymentFailureReason, PaymentPurpose, ReplayEvent,
19+
ClosureReason, Event as LdkEvent, FundingInfo, PaymentFailureReason, PaymentPurpose,
20+
ReplayEvent,
2021
};
2122
use lightning::impl_writeable_tlv_based_enum;
2223
use lightning::ln::channelmanager::PaymentId;
@@ -1516,7 +1517,26 @@ where
15161517
},
15171518
};
15181519
},
1519-
LdkEvent::DiscardFunding { .. } => {},
1520+
LdkEvent::DiscardFunding { channel_id, funding_info } => {
1521+
if let FundingInfo::Contribution { inputs: _, outputs } = funding_info {
1522+
log_info!(
1523+
self.logger,
1524+
"Reclaiming unused addresses from channel {} funding",
1525+
channel_id,
1526+
);
1527+
1528+
let tx = bitcoin::Transaction {
1529+
version: bitcoin::transaction::Version::TWO,
1530+
lock_time: bitcoin::absolute::LockTime::ZERO,
1531+
input: vec![],
1532+
output: outputs,
1533+
};
1534+
if let Err(e) = self.wallet.cancel_tx(&tx) {
1535+
log_error!(self.logger, "Failed reclaiming unused addresses: {}", e);
1536+
return Err(ReplayEvent());
1537+
}
1538+
}
1539+
},
15201540
LdkEvent::HTLCIntercepted {
15211541
requested_next_hop_scid,
15221542
intercept_id,
@@ -1746,7 +1766,6 @@ where
17461766
user_channel_id,
17471767
counterparty_node_id,
17481768
abandoned_funding_txo,
1749-
contributed_outputs,
17501769
..
17511770
} => {
17521771
if let Some(funding_txo) = abandoned_funding_txo {
@@ -1766,17 +1785,6 @@ where
17661785
);
17671786
}
17681787

1769-
let tx = bitcoin::Transaction {
1770-
version: bitcoin::transaction::Version::TWO,
1771-
lock_time: bitcoin::absolute::LockTime::ZERO,
1772-
input: vec![],
1773-
output: contributed_outputs,
1774-
};
1775-
if let Err(e) = self.wallet.cancel_tx(&tx) {
1776-
log_error!(self.logger, "Failed reclaiming unused addresses: {}", e);
1777-
return Err(ReplayEvent());
1778-
}
1779-
17801788
let event = Event::SpliceFailed {
17811789
channel_id,
17821790
user_channel_id: UserChannelId(user_channel_id),

src/payment/spontaneous.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl SpontaneousPayment {
128128
*max_channel_saturation_power_of_half;
129129
}
130130

131-
let mut recipient_fields = RecipientOnionFields::spontaneous_empty();
131+
let mut recipient_fields = RecipientOnionFields::spontaneous_empty(amount_msat);
132132
if let Some(tlvs) = custom_tlvs {
133133
let tlvs_vec = tlvs.into_iter().map(|tlv| (tlv.type_num, tlv.value)).collect();
134134
recipient_fields = recipient_fields.with_custom_tlvs(

0 commit comments

Comments
 (0)