Skip to content

[bug]: minFeeRate not capped by budget in LinearFeeFunction #9101

Open
@feelancer21

Description

@feelancer21

Studied a little bit the code around the LinearFeeFunction and found the following edge case. If the conf_target is greather equal than 1008 we return the min relay fee. This is not capped by the budget (endrate) of the fee function. E.g. if you have a min relay fee rate of 100 sat/vb an ad max fee rate given by the budget of 50 sat/vb NewLinearFeeFunction will return a fee function with a startingFeeRate of 100 sat/vb and an endingFeeRate of 50 sat/vb. Imho this will lead to a broadcasted sweep tx with 100 sat/vb.

lnd/sweep/fee_function.go

Lines 294 to 299 in e8c5e7d

if confTarget >= chainfee.MaxBlockTarget {
minFeeRate := l.estimator.RelayFeePerKW()
log.Infof("Conf target %v is greater than max block target, "+
"using min relay fee rate %v", confTarget, minFeeRate)
return minFeeRate, nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended code behaviourfeesRelated to the fees paid for transactions (both LN and funding/commitment transactions)utxo sweeping

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions