lnwallet: increase legacy fee limit threshold to 1k sats

In this commit, we increase the legacy fee limit threshold (the amount
below which we'll allow 100% of funds to go to fees for the non-v2 RPC
calls) from 50 sats to 1k sats.
This commit is contained in:
Olaoluwa Osuntokun committed 2022-02-03 11:54:01 -08:00
1 parent 04bbbea9a7
commit 80e304573c
6 files changed
+23 -19

No files matched your search

+5 -2
View File
@@ -8,10 +8,13 @@ import (
"github.com/lightningnetwork/lnd/lnwire"
)
const (
var (
// RoutingFee100PercentUpTo is the cut-off amount we allow 100% fees to
// be charged up to.
RoutingFee100PercentUpTo lnwire.MilliSatoshi = 50_000
RoutingFee100PercentUpTo = lnwire.NewMSatFromSatoshis(1_000)
)
const (
// DefaultRoutingFeePercentage is the default off-chain routing fee we
// allow to be charged for a payment over the RoutingFee100PercentUpTo
+5 -5
View File
@@ -24,12 +24,12 @@ func TestDefaultRoutingFeeLimitForAmount(t *testing.T) {
expectedLimit: 1,
},
{
amount: 50_000,
expectedLimit: 50_000,
amount: lnwire.NewMSatFromSatoshis(1_000),
expectedLimit: lnwire.NewMSatFromSatoshis(1_000),
},
{
amount: 50_001,
expectedLimit: 2_500,
amount: lnwire.NewMSatFromSatoshis(1_001),
expectedLimit: 50_050,
},
{
amount: 5_000_000_000,
@@ -42,7 +42,7 @@ func TestDefaultRoutingFeeLimitForAmount(t *testing.T) {
t.Run(fmt.Sprintf("%d sats", test.amount), func(t *testing.T) {
feeLimit := DefaultRoutingFeeLimitForAmount(test.amount)
require.Equal(t, test.expectedLimit, feeLimit)
require.Equal(t, int64(test.expectedLimit), int64(feeLimit))
})
}
}