config: make DefaultNumChanConfs part of chainConfig
This commit moves the definition of DefaultNumChanConfs into the chainConfig (such that it is set as e.g. "--bitcoin.defaultchanconfs"), making it possible to set individually for different chains. It also adds the flag DefaultRemoteDelay to the chainConfig, which can be used to set the CSV delay we will require the remote to wait before retrieving its own funds in case of an uncooperative close of the channel. Both these are set 0 by default (if not specified by the user), which in that case we will dynamically set the values, scaling them according to the channel size.
This commit is contained in:
parent
633878d497
commit
0815bd4eb0
@ -38,7 +38,6 @@ const (
|
|||||||
defaultPeerPort = 9735
|
defaultPeerPort = 9735
|
||||||
defaultRPCHost = "localhost"
|
defaultRPCHost = "localhost"
|
||||||
defaultMaxPendingChannels = 1
|
defaultMaxPendingChannels = 1
|
||||||
defaultNumChanConfs = 3
|
|
||||||
defaultNoEncryptWallet = false
|
defaultNoEncryptWallet = false
|
||||||
defaultTrickleDelay = 30 * 1000
|
defaultTrickleDelay = 30 * 1000
|
||||||
|
|
||||||
@ -89,6 +88,8 @@ type chainConfig struct {
|
|||||||
SimNet bool `long:"simnet" description:"Use the simulation test network"`
|
SimNet bool `long:"simnet" description:"Use the simulation test network"`
|
||||||
RegTest bool `long:"regtest" description:"Use the regression test network"`
|
RegTest bool `long:"regtest" description:"Use the regression test network"`
|
||||||
|
|
||||||
|
DefaultNumChanConfs int `long:"defaultchanconfs" description:"The default number of confirmations a channel must have before it's considered open. If this is not set, we will scale the value according to the channel size."`
|
||||||
|
DefaultRemoteDelay int `long:"defaultremotedelay" description:"The default number of blocks we will require our channel counterparty to wait before accessing its funds in case of unilateral close. If this is not set, we will scale the value according to the channel size."`
|
||||||
MinHTLC lnwire.MilliSatoshi `long:"minhtlc" description:"The smallest HTLC we are willing to forward on our channels, in millisatoshi"`
|
MinHTLC lnwire.MilliSatoshi `long:"minhtlc" description:"The smallest HTLC we are willing to forward on our channels, in millisatoshi"`
|
||||||
BaseFee lnwire.MilliSatoshi `long:"basefee" description:"The base fee in millisatoshi we will charge for forwarding payments on our channels"`
|
BaseFee lnwire.MilliSatoshi `long:"basefee" description:"The base fee in millisatoshi we will charge for forwarding payments on our channels"`
|
||||||
FeeRate lnwire.MilliSatoshi `long:"feerate" description:"The fee rate used when forwarding payments on our channels. The total fee charged is basefee + (amount * feerate / 1000000), where amount is the forwarded amount."`
|
FeeRate lnwire.MilliSatoshi `long:"feerate" description:"The fee rate used when forwarding payments on our channels. The total fee charged is basefee + (amount * feerate / 1000000), where amount is the forwarded amount."`
|
||||||
@ -146,8 +147,6 @@ type config struct {
|
|||||||
Litecoin *chainConfig `group:"Litecoin" namespace:"litecoin"`
|
Litecoin *chainConfig `group:"Litecoin" namespace:"litecoin"`
|
||||||
Bitcoin *chainConfig `group:"Bitcoin" namespace:"bitcoin"`
|
Bitcoin *chainConfig `group:"Bitcoin" namespace:"bitcoin"`
|
||||||
|
|
||||||
DefaultNumChanConfs int `long:"defaultchanconfs" description:"The default number of confirmations a channel must have before it's considered open."`
|
|
||||||
|
|
||||||
NeutrinoMode *neutrinoConfig `group:"neutrino" namespace:"neutrino"`
|
NeutrinoMode *neutrinoConfig `group:"neutrino" namespace:"neutrino"`
|
||||||
|
|
||||||
Autopilot *autoPilotConfig `group:"autopilot" namespace:"autopilot"`
|
Autopilot *autoPilotConfig `group:"autopilot" namespace:"autopilot"`
|
||||||
@ -181,7 +180,6 @@ func loadConfig() (*config, error) {
|
|||||||
RPCPort: defaultRPCPort,
|
RPCPort: defaultRPCPort,
|
||||||
RESTPort: defaultRESTPort,
|
RESTPort: defaultRESTPort,
|
||||||
MaxPendingChannels: defaultMaxPendingChannels,
|
MaxPendingChannels: defaultMaxPendingChannels,
|
||||||
DefaultNumChanConfs: defaultNumChanConfs,
|
|
||||||
NoEncryptWallet: defaultNoEncryptWallet,
|
NoEncryptWallet: defaultNoEncryptWallet,
|
||||||
Bitcoin: &chainConfig{
|
Bitcoin: &chainConfig{
|
||||||
RPCHost: defaultRPCHost,
|
RPCHost: defaultRPCHost,
|
||||||
|
Loading…
Reference in New Issue
Block a user