Skip to content

Commit 82e9545

Browse files
committed
lsp_plugin: change extra_fee value type to u64
Blip25 https://github.com/lightning/blips/blob/master/blip-0025.md uses u64 for the `amount_msat` in the `extra_fee` Signed-off-by: Peter Neuroth <[email protected]>
1 parent d3305fd commit 82e9545

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugins/lsps-plugin/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ async fn on_htlc_accepted(
445445

446446
// Safe unwrap(): we already checked that `extra_tlvs` exists.
447447
let extra_tlvs = req.htlc.extra_tlvs.unwrap();
448-
let deducted_amt = match extra_tlvs.get_tu64(65537)? {
448+
let deducted_amt = match extra_tlvs.get_u64(65537)? {
449449
Some(amt) => amt,
450450
None => {
451451
warn!("htlc is missing the extra_fee amount");

plugins/lsps-plugin/src/lsps2/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ impl<A: ClnApi> HtlcAcceptedHookHandler<A> {
559559
// G) We got a working channel, deduct fee and forward htlc.
560560
let deducted_amt_msat = req.htlc.amount_msat.msat() - opening_fee;
561561
let mut payload = req.onion.payload.clone();
562-
payload.set_tu64(TLV_FORWARD_AMT, deducted_amt_msat);
562+
payload.set_u64(TLV_FORWARD_AMT, deducted_amt_msat);
563563

564564
// It is okay to unwrap the next line as we do not have duplicate entries.
565565
let payload_bytes = payload.to_bytes().unwrap();

0 commit comments

Comments
 (0)