mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-09 21:56:47 +01: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:
@@ -64,6 +64,9 @@ var defaultSetDesc = setDesc{
|
||||
SetInit: {}, // I
|
||||
SetNodeAnn: {}, // N
|
||||
},
|
||||
lnwire.KeysendOptional: {
|
||||
SetNodeAnn: {}, // N
|
||||
},
|
||||
lnwire.ScriptEnforcedLeaseOptional: {
|
||||
SetInit: {}, // I
|
||||
SetNodeAnn: {}, // N
|
||||
|
||||
@@ -69,6 +69,9 @@ var deps = depDesc{
|
||||
lnwire.ExplicitChannelTypeOptional: {},
|
||||
lnwire.AnchorsZeroFeeHtlcTxOptional: {},
|
||||
},
|
||||
lnwire.KeysendOptional: {
|
||||
lnwire.TLVOnionPayloadOptional: {},
|
||||
},
|
||||
}
|
||||
|
||||
// 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
|
||||
// enforced leases.
|
||||
NoScriptEnforcementLease bool
|
||||
|
||||
// NoKeysend unsets any bits signaling support for accepting keysend
|
||||
// payments.
|
||||
NoKeysend bool
|
||||
}
|
||||
|
||||
// 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.AMPOptional)
|
||||
raw.Unset(lnwire.AMPRequired)
|
||||
raw.Unset(lnwire.KeysendOptional)
|
||||
raw.Unset(lnwire.KeysendRequired)
|
||||
}
|
||||
if cfg.NoStaticRemoteKey {
|
||||
raw.Unset(lnwire.StaticRemoteKeyOptional)
|
||||
@@ -115,6 +121,10 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
|
||||
raw.Unset(lnwire.ScriptEnforcedLeaseOptional)
|
||||
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
|
||||
// dependent features.
|
||||
|
||||
Reference in New Issue
Block a user