mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
multi: announce Keysend feature bit
In this commit, we add the keysend feature bit to our NodeAnnouncement if the accept-keysend option is set.
This commit is contained in:
@ -172,6 +172,9 @@ then watch it on chain. Taproot script spends are also supported through the
|
|||||||
|
|
||||||
* [The CI and build infrastructure for the project has transitioned to using Go 1.18](https://github.com/lightningnetwork/lnd/pull/6340).
|
* [The CI and build infrastructure for the project has transitioned to using Go 1.18](https://github.com/lightningnetwork/lnd/pull/6340).
|
||||||
|
|
||||||
|
* [Announce the keysend feature bit in NodeAnnouncement if `--accept-keysend`
|
||||||
|
is set](https://github.com/lightningnetwork/lnd/pull/6414)
|
||||||
|
|
||||||
## RPC Server
|
## RPC Server
|
||||||
|
|
||||||
* [Add value to the field
|
* [Add value to the field
|
||||||
|
@ -64,6 +64,9 @@ var defaultSetDesc = setDesc{
|
|||||||
SetInit: {}, // I
|
SetInit: {}, // I
|
||||||
SetNodeAnn: {}, // N
|
SetNodeAnn: {}, // N
|
||||||
},
|
},
|
||||||
|
lnwire.KeysendOptional: {
|
||||||
|
SetNodeAnn: {}, // N
|
||||||
|
},
|
||||||
lnwire.ScriptEnforcedLeaseOptional: {
|
lnwire.ScriptEnforcedLeaseOptional: {
|
||||||
SetInit: {}, // I
|
SetInit: {}, // I
|
||||||
SetNodeAnn: {}, // N
|
SetNodeAnn: {}, // N
|
||||||
|
@ -69,6 +69,9 @@ var deps = depDesc{
|
|||||||
lnwire.ExplicitChannelTypeOptional: {},
|
lnwire.ExplicitChannelTypeOptional: {},
|
||||||
lnwire.AnchorsZeroFeeHtlcTxOptional: {},
|
lnwire.AnchorsZeroFeeHtlcTxOptional: {},
|
||||||
},
|
},
|
||||||
|
lnwire.KeysendOptional: {
|
||||||
|
lnwire.TLVOnionPayloadOptional: {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateDeps asserts that a feature vector sets all features and their
|
// ValidateDeps asserts that a feature vector sets all features and their
|
||||||
|
@ -27,6 +27,10 @@ type Config struct {
|
|||||||
// NoScriptEnforcementLease unsets any bits signaling support for script
|
// NoScriptEnforcementLease unsets any bits signaling support for script
|
||||||
// enforced leases.
|
// enforced leases.
|
||||||
NoScriptEnforcementLease bool
|
NoScriptEnforcementLease bool
|
||||||
|
|
||||||
|
// NoKeysend unsets any bits signaling support for accepting keysend
|
||||||
|
// payments.
|
||||||
|
NoKeysend bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manager is responsible for generating feature vectors for different requested
|
// Manager is responsible for generating feature vectors for different requested
|
||||||
@ -83,6 +87,8 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
|
|||||||
raw.Unset(lnwire.MPPRequired)
|
raw.Unset(lnwire.MPPRequired)
|
||||||
raw.Unset(lnwire.AMPOptional)
|
raw.Unset(lnwire.AMPOptional)
|
||||||
raw.Unset(lnwire.AMPRequired)
|
raw.Unset(lnwire.AMPRequired)
|
||||||
|
raw.Unset(lnwire.KeysendOptional)
|
||||||
|
raw.Unset(lnwire.KeysendRequired)
|
||||||
}
|
}
|
||||||
if cfg.NoStaticRemoteKey {
|
if cfg.NoStaticRemoteKey {
|
||||||
raw.Unset(lnwire.StaticRemoteKeyOptional)
|
raw.Unset(lnwire.StaticRemoteKeyOptional)
|
||||||
@ -115,6 +121,10 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
|
|||||||
raw.Unset(lnwire.ScriptEnforcedLeaseOptional)
|
raw.Unset(lnwire.ScriptEnforcedLeaseOptional)
|
||||||
raw.Unset(lnwire.ScriptEnforcedLeaseRequired)
|
raw.Unset(lnwire.ScriptEnforcedLeaseRequired)
|
||||||
}
|
}
|
||||||
|
if cfg.NoKeysend {
|
||||||
|
raw.Unset(lnwire.KeysendOptional)
|
||||||
|
raw.Unset(lnwire.KeysendRequired)
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure that all of our feature sets properly set any
|
// Ensure that all of our feature sets properly set any
|
||||||
// dependent features.
|
// dependent features.
|
||||||
|
@ -165,7 +165,15 @@ const (
|
|||||||
// htlc(s).
|
// htlc(s).
|
||||||
PaymentMetadataOptional = 49
|
PaymentMetadataOptional = 49
|
||||||
|
|
||||||
// ScriptEnforcedLeaseOptional is an optional feature bit that signals
|
// KeysendRequired is a required bit that indicates that the node is
|
||||||
|
// able and willing to accept keysend payments.
|
||||||
|
KeysendRequired = 54
|
||||||
|
|
||||||
|
// KeysendOptional is an optional bit that indicates that the node is
|
||||||
|
// able and willing to accept keysend payments.
|
||||||
|
KeysendOptional = 55
|
||||||
|
|
||||||
|
// ScriptEnforcedLeaseRequired is a required feature bit that signals
|
||||||
// that the node requires channels having zero-fee second-level HTLC
|
// that the node requires channels having zero-fee second-level HTLC
|
||||||
// transactions, which also imply anchor commitments, along with an
|
// transactions, which also imply anchor commitments, along with an
|
||||||
// additional CLTV constraint of a channel lease's expiration height
|
// additional CLTV constraint of a channel lease's expiration height
|
||||||
@ -174,7 +182,7 @@ const (
|
|||||||
// TODO: Decide on actual feature bit value.
|
// TODO: Decide on actual feature bit value.
|
||||||
ScriptEnforcedLeaseRequired FeatureBit = 2022
|
ScriptEnforcedLeaseRequired FeatureBit = 2022
|
||||||
|
|
||||||
// ScriptEnforcedLeaseOptional is a required feature bit that signals
|
// ScriptEnforcedLeaseOptional is an optional feature bit that signals
|
||||||
// that the node requires channels having zero-fee second-level HTLC
|
// that the node requires channels having zero-fee second-level HTLC
|
||||||
// transactions, which also imply anchor commitments, along with an
|
// transactions, which also imply anchor commitments, along with an
|
||||||
// additional CLTV constraint of a channel lease's expiration height
|
// additional CLTV constraint of a channel lease's expiration height
|
||||||
@ -232,6 +240,8 @@ var Features = map[FeatureBit]string{
|
|||||||
PaymentMetadataRequired: "payment-metadata",
|
PaymentMetadataRequired: "payment-metadata",
|
||||||
ExplicitChannelTypeOptional: "explicit-commitment-type",
|
ExplicitChannelTypeOptional: "explicit-commitment-type",
|
||||||
ExplicitChannelTypeRequired: "explicit-commitment-type",
|
ExplicitChannelTypeRequired: "explicit-commitment-type",
|
||||||
|
KeysendOptional: "keysend",
|
||||||
|
KeysendRequired: "keysend",
|
||||||
ScriptEnforcedLeaseRequired: "script-enforced-lease",
|
ScriptEnforcedLeaseRequired: "script-enforced-lease",
|
||||||
ScriptEnforcedLeaseOptional: "script-enforced-lease",
|
ScriptEnforcedLeaseOptional: "script-enforced-lease",
|
||||||
}
|
}
|
||||||
|
@ -529,6 +529,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
|||||||
NoAnchors: cfg.ProtocolOptions.NoAnchorCommitments(),
|
NoAnchors: cfg.ProtocolOptions.NoAnchorCommitments(),
|
||||||
NoWumbo: !cfg.ProtocolOptions.Wumbo(),
|
NoWumbo: !cfg.ProtocolOptions.Wumbo(),
|
||||||
NoScriptEnforcementLease: cfg.ProtocolOptions.NoScriptEnforcementLease(),
|
NoScriptEnforcementLease: cfg.ProtocolOptions.NoScriptEnforcementLease(),
|
||||||
|
NoKeysend: !cfg.AcceptKeySend,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user