Skip to content

Commit 417436b

Browse files
jkczyztankyleo
authored andcommitted
Bump the ldk-node dependency
1 parent cd0b6ea commit 417436b

File tree

8 files changed

+960
-661
lines changed

8 files changed

+960
-661
lines changed

Cargo.lock

Lines changed: 919 additions & 644 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ldk-server-protos/src/proto/types.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ message Bolt11Jit {
101101
// See [`LdkChannelConfig::accept_underpaying_htlcs`](https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.accept_underpaying_htlcs)
102102
// for more information.
103103
LSPFeeLimits lsp_fee_limits = 4;
104+
105+
// The value, in thousands of a satoshi, that was deducted from this payment as an extra
106+
// fee taken by our channel counterparty.
107+
//
108+
// Will only be `Some` once we received the payment.
109+
optional uint64 counterparty_skimmed_fee_msat = 5;
104110
}
105111

106112
// Represents a BOLT 12 ‘offer’ payment, i.e., a payment for an Offer.

ldk-server-protos/src/types.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ pub struct Bolt11Jit {
134134
/// for more information.
135135
#[prost(message, optional, tag = "4")]
136136
pub lsp_fee_limits: ::core::option::Option<LspFeeLimits>,
137+
/// The value, in thousands of a satoshi, that was deducted from this payment as an extra
138+
/// fee taken by our channel counterparty.
139+
///
140+
/// Will only be `Some` once we received the payment.
141+
#[prost(uint64, optional, tag = "5")]
142+
pub counterparty_skimmed_fee_msat: ::core::option::Option<u64>,
137143
}
138144
/// Represents a BOLT 12 ‘offer’ payment, i.e., a payment for an Offer.
139145
#[allow(clippy::derive_partial_eq_without_eq)]

ldk-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
ldk-node = { git = "https://github.com/lightningdevkit/ldk-node.git", rev = "f0338d19256615088fabab2b6927d478ae3ec1a1" }
7+
ldk-node = { git = "https://github.com/lightningdevkit/ldk-node.git", rev = "1dd9827c274c3f1c11d2d5a5692f63a74bb1fa69" }
88
serde = { version = "1.0.203", default-features = false, features = ["derive"] }
99
hyper = { version = "1", default-features = false, features = ["server", "http1"] }
1010
http-body-util = { version = "0.1", default-features = false }

ldk-server/src/api/bolt12_send.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ pub(crate) fn handle_bolt12_send_request(
1313
Offer::from_str(&request.offer.as_str()).map_err(|_| ldk_node::NodeError::InvalidOffer)?;
1414

1515
let payment_id = match request.amount_msat {
16-
None => context.node.bolt12_payment().send(&offer, request.quantity, request.payer_note),
16+
None => {
17+
context.node.bolt12_payment().send(&offer, request.quantity, request.payer_note, None)
18+
},
1719
Some(amount_msat) => context.node.bolt12_payment().send_using_amount(
1820
&offer,
1921
amount_msat,
2022
request.quantity,
2123
request.payer_note,
24+
None,
2225
),
2326
}?;
2427

ldk-server/src/api/error.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ impl From<NodeError> for LdkServerError {
7878
| NodeError::InvalidNodeAlias
7979
| NodeError::InvalidDateTime
8080
| NodeError::InvalidFeeRate
81-
| NodeError::UriParameterParsingFailed => {
81+
| NodeError::UriParameterParsingFailed
82+
| NodeError::InvalidBlindedPaths
83+
| NodeError::AsyncPaymentServicesDisabled => {
8284
(error.to_string(), LdkServerErrorCode::InvalidRequestError)
8385
},
8486

ldk-server/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ fn main() {
107107
},
108108
};
109109

110+
builder.set_runtime(runtime.handle().clone());
111+
110112
let node = match builder.build() {
111113
Ok(node) => Arc::new(node),
112114
Err(e) => {
@@ -136,7 +138,7 @@ fn main() {
136138
};
137139

138140
println!("Starting up...");
139-
match node.start_with_runtime(Arc::clone(&runtime)) {
141+
match node.start() {
140142
Ok(()) => {},
141143
Err(e) => {
142144
eprintln!("Failed to start up LDK Node: {}", e);

ldk-server/src/util/proto_adapter.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,24 @@ pub(crate) fn payment_kind_to_proto(
147147
secret: secret.map(|s| Bytes::copy_from_slice(&s.0)),
148148
})),
149149
},
150-
PaymentKind::Bolt11Jit { hash, preimage, secret, lsp_fee_limits } => {
151-
ldk_server_protos::types::PaymentKind {
152-
kind: Some(Bolt11Jit(ldk_server_protos::types::Bolt11Jit {
153-
hash: hash.to_string(),
154-
preimage: preimage.map(|p| p.to_string()),
155-
secret: secret.map(|s| Bytes::copy_from_slice(&s.0)),
156-
lsp_fee_limits: Some(LspFeeLimits {
157-
max_total_opening_fee_msat: lsp_fee_limits.max_total_opening_fee_msat,
158-
max_proportional_opening_fee_ppm_msat: lsp_fee_limits
159-
.max_proportional_opening_fee_ppm_msat,
160-
}),
161-
})),
162-
}
150+
PaymentKind::Bolt11Jit {
151+
hash,
152+
preimage,
153+
secret,
154+
lsp_fee_limits,
155+
counterparty_skimmed_fee_msat,
156+
} => ldk_server_protos::types::PaymentKind {
157+
kind: Some(Bolt11Jit(ldk_server_protos::types::Bolt11Jit {
158+
hash: hash.to_string(),
159+
preimage: preimage.map(|p| p.to_string()),
160+
secret: secret.map(|s| Bytes::copy_from_slice(&s.0)),
161+
lsp_fee_limits: Some(LspFeeLimits {
162+
max_total_opening_fee_msat: lsp_fee_limits.max_total_opening_fee_msat,
163+
max_proportional_opening_fee_ppm_msat: lsp_fee_limits
164+
.max_proportional_opening_fee_ppm_msat,
165+
}),
166+
counterparty_skimmed_fee_msat,
167+
})),
163168
},
164169
PaymentKind::Bolt12Offer { hash, preimage, secret, offer_id, payer_note, quantity } => {
165170
ldk_server_protos::types::PaymentKind {

0 commit comments

Comments
 (0)