From 0aeb7c4ba2426b953a7822e0282dbea6838528f4 Mon Sep 17 00:00:00 2001 From: Carla Kirk-Cohen Date: Thu, 15 Feb 2024 14:13:51 -0500 Subject: [PATCH] multi/refactor: clarify blinded payment fee rate field name --- lnrpc/routerrpc/router_backend.go | 2 +- routing/blinding.go | 8 ++++---- routing/blinding_test.go | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lnrpc/routerrpc/router_backend.go b/lnrpc/routerrpc/router_backend.go index 64dd6917f0..5768488a34 100644 --- a/lnrpc/routerrpc/router_backend.go +++ b/lnrpc/routerrpc/router_backend.go @@ -490,7 +490,7 @@ func unmarshalBlindedPayment(rpcPayment *lnrpc.BlindedPaymentPath) ( BlindedPath: path, CltvExpiryDelta: uint16(rpcPayment.TotalCltvDelta), BaseFee: uint32(rpcPayment.BaseFeeMsat), - ProportionalFee: uint32( + ProportionalFeeRate: uint32( rpcPayment.ProportionalFeeMsat, ), HtlcMinimum: rpcPayment.HtlcMinMsat, diff --git a/routing/blinding.go b/routing/blinding.go index 61d303a0c9..fd0a9c369d 100644 --- a/routing/blinding.go +++ b/routing/blinding.go @@ -36,9 +36,9 @@ type BlindedPayment struct { // blinded path. BaseFee uint32 - // ProportionalFee is the aggregated proportional fee for payments - // made over the blinded path. - ProportionalFee uint32 + // ProportionalFeeRate is the aggregated proportional fee rate for + // payments made over the blinded path. + ProportionalFeeRate uint32 // CltvExpiryDelta is the total expiry delta for the blinded path. Note // this does not include the final cltv delta for the receiving node @@ -122,7 +122,7 @@ func (b *BlindedPayment) toRouteHints() RouteHints { MaxHTLC: lnwire.MilliSatoshi(b.HtlcMaximum), FeeBaseMSat: lnwire.MilliSatoshi(b.BaseFee), FeeProportionalMillionths: lnwire.MilliSatoshi( - b.ProportionalFee, + b.ProportionalFeeRate, ), ToNodePubKey: func() route.Vertex { return route.NewVertex( diff --git a/routing/blinding_test.go b/routing/blinding_test.go index 561ace6fc1..69b25c696f 100644 --- a/routing/blinding_test.go +++ b/routing/blinding_test.go @@ -121,12 +121,12 @@ func TestBlindedPaymentToHints(t *testing.T) { {}, }, }, - BaseFee: baseFee, - ProportionalFee: ppmFee, - CltvExpiryDelta: cltvDelta, - HtlcMinimum: htlcMin, - HtlcMaximum: htlcMax, - Features: features, + BaseFee: baseFee, + ProportionalFeeRate: ppmFee, + CltvExpiryDelta: cltvDelta, + HtlcMinimum: htlcMin, + HtlcMaximum: htlcMax, + Features: features, } require.Nil(t, blindedPayment.toRouteHints())