mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
sweep+itest: change MaxFeeRate
to use SatPerVbyte
This commit is contained in:
parent
bea0ffdf81
commit
258fe7999b
4 changed files with 12 additions and 12 deletions
|
@ -231,9 +231,7 @@ func runCPFP(ht *lntest.HarnessTest, alice, bob *node.HarnessNode) {
|
|||
// CPFP from Alice's point of view.
|
||||
bumpFeeReq := &walletrpc.BumpFeeRequest{
|
||||
Outpoint: op,
|
||||
SatPerVbyte: uint64(
|
||||
sweep.DefaultMaxFeeRate.FeePerKVByte() / 2000,
|
||||
),
|
||||
SatPerVbyte: uint64(sweep.DefaultMaxFeeRate),
|
||||
}
|
||||
bob.RPC.BumpFee(bumpFeeReq)
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ package sweep
|
|||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -9,4 +11,9 @@ var (
|
|||
// window. The sweep is held back during the batch window to allow more
|
||||
// inputs to be added and thereby lower the fee per input.
|
||||
DefaultBatchWindowDuration = 30 * time.Second
|
||||
|
||||
// DefaultMaxFeeRate is the default maximum fee rate allowed within the
|
||||
// UtxoSweeper. The current value is equivalent to a fee rate of 1,000
|
||||
// sat/vbyte.
|
||||
DefaultMaxFeeRate chainfee.SatPerVByte = 1e3
|
||||
)
|
||||
|
|
|
@ -21,11 +21,6 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// DefaultMaxFeeRate is the default maximum fee rate allowed within the
|
||||
// UtxoSweeper. The current value is equivalent to a fee rate of 1,000
|
||||
// sat/vbyte.
|
||||
DefaultMaxFeeRate = chainfee.AbsoluteFeePerKwFloor * 1e3
|
||||
|
||||
// DefaultFeeRateBucketSize is the default size of fee rate buckets
|
||||
// we'll use when clustering inputs into buckets with similar fee rates
|
||||
// within the UtxoSweeper.
|
||||
|
@ -288,7 +283,7 @@ type UtxoSweeperConfig struct {
|
|||
|
||||
// MaxFeeRate is the the maximum fee rate allowed within the
|
||||
// UtxoSweeper.
|
||||
MaxFeeRate chainfee.SatPerKWeight
|
||||
MaxFeeRate chainfee.SatPerVByte
|
||||
|
||||
// FeeRateBucketSize is the default size of fee rate buckets we'll use
|
||||
// when clustering inputs into buckets with similar fee rates within the
|
||||
|
@ -483,7 +478,7 @@ func (s *UtxoSweeper) feeRateForPreference(
|
|||
return 0, fmt.Errorf("fee preference resulted in invalid fee "+
|
||||
"rate %v, minimum is %v", feeRate, s.relayFeeRate)
|
||||
}
|
||||
if feeRate > s.cfg.MaxFeeRate {
|
||||
if feeRate > s.cfg.MaxFeeRate.FeePerKWeight() {
|
||||
return 0, fmt.Errorf("fee preference resulted in invalid fee "+
|
||||
"rate %v, maximum is %v", feeRate, s.cfg.MaxFeeRate)
|
||||
}
|
||||
|
|
|
@ -1186,7 +1186,7 @@ func TestBumpFeeRBF(t *testing.T) {
|
|||
|
||||
// We'll then attempt to bump its fee rate.
|
||||
highFeePref := FeePreference{ConfTarget: 6}
|
||||
highFeeRate := DefaultMaxFeeRate
|
||||
highFeeRate := DefaultMaxFeeRate.FeePerKWeight()
|
||||
ctx.estimator.blocksToFee[highFeePref.ConfTarget] = highFeeRate
|
||||
|
||||
// We should expect to see an error if a fee preference isn't provided.
|
||||
|
|
Loading…
Add table
Reference in a new issue