mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
server+lncfg: protocol flag to enable scid-alias, zero-conf feature bits
This allows the zero-conf and scid-alias feature bits to be toggled using the config. The feature bits are off by default to protect users from accidentally incurring the risk of a zero-conf channel.
This commit is contained in:
parent
113de58d77
commit
c815fb8de7
@ -29,6 +29,15 @@ type ProtocolOptions struct {
|
||||
// opening or accepting channels having the script enforced commitment
|
||||
// type for leased channel.
|
||||
NoScriptEnforcedLease bool `long:"no-script-enforced-lease" description:"disable support for script enforced lease commitments"`
|
||||
|
||||
// OptionScidAlias should be set if we want to signal the
|
||||
// option-scid-alias feature bit. This allows scid aliases and the
|
||||
// option-scid-alias channel-type.
|
||||
OptionScidAlias bool `long:"option-scid-alias" description:"enable support for option_scid_alias channels"`
|
||||
|
||||
// OptionZeroConf should be set if we want to signal the zero-conf
|
||||
// feature bit.
|
||||
OptionZeroConf bool `long:"zero-conf" description:"enable support for zero-conf channels, must have option-scid-alias set also"`
|
||||
}
|
||||
|
||||
// Wumbo returns true if lnd should permit the creation and acceptance of wumbo
|
||||
@ -48,3 +57,13 @@ func (l *ProtocolOptions) NoAnchorCommitments() bool {
|
||||
func (l *ProtocolOptions) NoScriptEnforcementLease() bool {
|
||||
return l.NoScriptEnforcedLease
|
||||
}
|
||||
|
||||
// ScidAlias returns true if we have enabled the option-scid-alias feature bit.
|
||||
func (l *ProtocolOptions) ScidAlias() bool {
|
||||
return l.OptionScidAlias
|
||||
}
|
||||
|
||||
// ZeroConf returns true if we have enabled the zero-conf feature bit.
|
||||
func (l *ProtocolOptions) ZeroConf() bool {
|
||||
return l.OptionZeroConf
|
||||
}
|
||||
|
@ -30,6 +30,15 @@ type ProtocolOptions struct {
|
||||
//
|
||||
// TODO: Move to experimental?
|
||||
ScriptEnforcedLease bool `long:"script-enforced-lease" description:"enable support for script enforced lease commitments"`
|
||||
|
||||
// OptionScidAlias should be set if we want to signal the
|
||||
// option-scid-alias feature bit. This allows scid aliases and the
|
||||
// option-scid-alias channel-type.
|
||||
OptionScidAlias bool `long:"option-scid-alias" description:"enable support for option_scid_alias channels"`
|
||||
|
||||
// OptionZeroConf should be set if we want to signal the zero-conf
|
||||
// feature bit.
|
||||
OptionZeroConf bool `long:"zero-conf" description:"enable support for zero-conf channels, must have option-scid-alias set also"`
|
||||
}
|
||||
|
||||
// Wumbo returns true if lnd should permit the creation and acceptance of wumbo
|
||||
@ -49,3 +58,13 @@ func (l *ProtocolOptions) NoAnchorCommitments() bool {
|
||||
func (l *ProtocolOptions) NoScriptEnforcementLease() bool {
|
||||
return !l.ScriptEnforcedLease
|
||||
}
|
||||
|
||||
// ScidAlias returns true if we have enabled the option-scid-alias feature bit.
|
||||
func (l *ProtocolOptions) ScidAlias() bool {
|
||||
return l.OptionScidAlias
|
||||
}
|
||||
|
||||
// ZeroConf returns true if we have enabled the zero-conf feature bit.
|
||||
func (l *ProtocolOptions) ZeroConf() bool {
|
||||
return l.OptionZeroConf
|
||||
}
|
||||
|
@ -530,6 +530,8 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
NoWumbo: !cfg.ProtocolOptions.Wumbo(),
|
||||
NoScriptEnforcementLease: cfg.ProtocolOptions.NoScriptEnforcementLease(),
|
||||
NoKeysend: !cfg.AcceptKeySend,
|
||||
NoOptionScidAlias: !cfg.ProtocolOptions.ScidAlias(),
|
||||
NoZeroConf: !cfg.ProtocolOptions.ZeroConf(),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user