You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chainfee: make relay fee floor configurable via --fee.min-relay-feerate
The minimum relay fee rate is currently hardcoded to FeePerKwFloor
(253 sat/kw, ~1 sat/vb). This prevents operators running nodes that
connect to a Bitcoin backend with a lower minrelaytxfee from opening
channels or sweeping funds at sub-1 sat/vb rates.
This commit introduces a new --fee.min-relay-feerate option (in sat/vb)
that lets operators lower the floor when their setup permits it. The
default remains 1 sat/vb, preserving existing behaviour for all nodes.
Changes:
- lnwallet/chainfee/minfeemanager: accept a feeFloor parameter instead
of always clamping to the package-level FeePerKwFloor constant
- lnwallet/chainfee/estimator: thread feeFloor through BtcdEstimator,
BitcoindEstimator, and WebAPIEstimator constructors; use the
configured floor in EstimateFeePerKW clamping and relay fee fallback
- sweep/walletsweep: remove the unconditional 250→253 sat/kw bump; the
downstream minFeeRate check already enforces the relay floor
- chainreg/chainregistry: pass cfg.Fee.FeeFloorKW() to all estimator
constructors and to the static estimator
- lncfg/fee: add MinRelayFeeRate field with Validate() and FeeFloorKW()
helpers
- sample-lnd.conf: document the new fee.min-relay-feerate option
WARNING: lowering this value below 1 sat/vb means your node will create
transactions that standard Bitcoin nodes will not relay. Only use this
option if your backend has a matching minrelaytxfee and you have a
direct path to a miner's mempool.
Signed-off-by: Kilombino <kilombino@proton.me>
// Fee holds the configuration options for fee estimation.
14
25
//
15
26
//nolint:ll
16
27
typeFeestruct {
17
-
URLstring`long:"url" description:"Optional URL for external fee estimation. If no URL is specified, the method for fee estimation will depend on the chosen backend and network. Must be set for neutrino on mainnet."`
18
-
MinUpdateTimeout time.Duration`long:"min-update-timeout" description:"The minimum interval in which fees will be updated from the specified fee URL."`
19
-
MaxUpdateTimeout time.Duration`long:"max-update-timeout" description:"The maximum interval in which fees will be updated from the specified fee URL."`
28
+
URLstring`long:"url" description:"Optional URL for external fee estimation. If no URL is specified, the method for fee estimation will depend on the chosen backend and network. Must be set for neutrino on mainnet."`
29
+
MinUpdateTimeout time.Duration`long:"min-update-timeout" description:"The minimum interval in which fees will be updated from the specified fee URL."`
30
+
MaxUpdateTimeout time.Duration`long:"max-update-timeout" description:"The maximum interval in which fees will be updated from the specified fee URL."`
31
+
MinRelayFeeRate chainfee.SatPerVByte`long:"min-relay-feerate" description:"Minimum fee rate floor in sat/vb used when estimating and enforcing on-chain fees. Lowering this below 1 sat/vb is only safe when your Bitcoin backend is configured with a matching minrelaytxfee and you control the path to miners. Default: 1 sat/vb (250 sat/kw)."`
32
+
}
33
+
34
+
// Validate checks the fee configuration for invalid values.
35
+
func (f*Fee) Validate() error {
36
+
iff.MinRelayFeeRate<0 {
37
+
returnfmt.Errorf("fee.min-relay-feerate must be >= 0")
38
+
}
39
+
40
+
returnnil
41
+
}
42
+
43
+
// FeeFloorKW returns the configured minimum relay fee rate as sat/kw.
0 commit comments