Skip to content

Commit 1e2b16c

Browse files
jkczyzclaude
andcommitted
Pass None for new inbound-payment metadata argument
LDK's `ChannelManager::create_inbound_payment`, `create_inbound_payment_for_hash`, and `get_payment_preimage` each grew a trailing `payment_metadata: Option<&[u8]>` argument so the inbound payment can commit to caller-supplied metadata. ldk-node has nothing to attach yet — pass `None`. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent cfa863d commit 1e2b16c

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ default = []
4040
#lightning-macros = { version = "0.2.0" }
4141
#lightning-dns-resolver = { version = "0.3.0" }
4242

43-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] }
44-
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" }
45-
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] }
46-
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" }
47-
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["tokio"] }
48-
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" }
49-
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" }
50-
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["rest-client", "rpc-client", "tokio"] }
51-
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
52-
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] }
53-
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" }
54-
lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" }
43+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] }
44+
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" }
45+
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] }
46+
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" }
47+
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["tokio"] }
48+
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" }
49+
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" }
50+
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["rest-client", "rpc-client", "tokio"] }
51+
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
52+
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] }
53+
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" }
54+
lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" }
5555

5656
bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] }
5757
bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]}
@@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false }
8181
vss-client = { package = "vss-client-ng", version = "0.5" }
8282
prost = { version = "0.11.6", default-features = false}
8383
#bitcoin-payment-instructions = { version = "0.6" }
84-
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "95ee1d08c47ec2c0d0f8c358c64a4b178befb009" }
84+
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "beeb5d530fc14bb1fc0564dc39ecf57c4a92a53d" }
8585

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

8989
[dev-dependencies]
90-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std", "_test_utils"] }
90+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std", "_test_utils"] }
9191
rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] }
9292
proptest = "1.0.0"
9393
regex = "1.5.6"

src/liquidity.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ where
13131313
None,
13141314
expiry_secs,
13151315
Some(min_final_cltv_expiry_delta),
1316+
None,
13161317
)
13171318
.map_err(|e| {
13181319
log_error!(self.logger, "Failed to register inbound payment: {:?}", e);
@@ -1322,7 +1323,7 @@ where
13221323
},
13231324
None => self
13241325
.channel_manager
1325-
.create_inbound_payment(None, expiry_secs, Some(min_final_cltv_expiry_delta))
1326+
.create_inbound_payment(None, expiry_secs, Some(min_final_cltv_expiry_delta), None)
13261327
.map_err(|e| {
13271328
log_error!(self.logger, "Failed to register inbound payment: {:?}", e);
13281329
Error::InvoiceCreationFailed

src/payment/bolt11.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Bolt11Payment {
121121
// will know the preimage at this point.
122122
let res = self
123123
.channel_manager
124-
.get_payment_preimage(payment_hash, payment_secret.clone())
124+
.get_payment_preimage(payment_hash, payment_secret.clone(), None)
125125
.ok();
126126
debug_assert!(res.is_some(), "We just let ChannelManager create an inbound payment, it can't have forgotten the preimage by now.");
127127
res
@@ -206,8 +206,10 @@ impl Bolt11Payment {
206206
max_proportional_opening_fee_ppm_msat: lsp_prop_opening_fee,
207207
};
208208
let id = PaymentId(payment_hash.0);
209-
let preimage =
210-
self.channel_manager.get_payment_preimage(payment_hash, payment_secret.clone()).ok();
209+
let preimage = self
210+
.channel_manager
211+
.get_payment_preimage(payment_hash, payment_secret.clone(), None)
212+
.ok();
211213
let kind = PaymentKind::Bolt11Jit {
212214
hash: payment_hash,
213215
preimage,

0 commit comments

Comments
 (0)