2019-08-06 07:34:46 +03:00
// +build dev
package lncfg
2020-07-09 00:26:05 +03:00
// Legacy is a sub-config that houses all the legacy protocol options. These
// are mostly used for integration tests as most modern nodes shuld always run
// with them on by default.
type LegacyProtocol struct {
2020-03-06 18:11:48 +03:00
// LegacyOnionFormat if set to true, then we won't signal
// TLVOnionPayloadOptional. As a result, nodes that include us in the
// route won't use the new modern onion framing.
2020-07-09 00:26:05 +03:00
LegacyOnionFormat bool ` long:"onion" description:"force node to not advertise the new modern TLV onion format" `
2019-09-11 15:44:31 +03:00
// CommitmentTweak guards if we should use the old legacy commitment
// protocol, or the newer variant that doesn't have a tweak for the
// remote party's output in the commitment. If set to true, then we
// won't signal StaticRemoteKeyOptional.
CommitmentTweak bool ` long:"committweak" description:"force node to not advertise the new commitment format" `
2020-11-30 03:12:44 +03:00
// NoGossipUpdateThrottle if true, then gossip updates won't be
// throttled using the current set of heuristics. This should mainly be
// used for integration tests where we want nearly instant propagation
// of gossip updates.
NoGossipUpdateThrottle bool ` long:"no-gossip-throttle" description:"if true, then gossip updates will not be throttled to once per rebroadcast interval for non keep-alive updates" `
2019-08-06 07:34:46 +03:00
}
// LegacyOnion returns true if the old legacy onion format should be used when
// we're an intermediate or final hop. This controls if we set the
// TLVOnionPayloadOptional bit or not.
2020-07-09 00:26:05 +03:00
func ( l * LegacyProtocol ) LegacyOnion ( ) bool {
2020-03-06 18:11:48 +03:00
return l . LegacyOnionFormat
2019-08-06 07:34:46 +03:00
}
2019-09-11 15:44:31 +03:00
2020-03-06 18:11:48 +03:00
// NoStaticRemoteKey returns true if the old commitment format with a tweaked
// remote key should be used for new funded channels.
2020-07-09 00:26:05 +03:00
func ( l * LegacyProtocol ) NoStaticRemoteKey ( ) bool {
2019-09-11 15:44:31 +03:00
return l . CommitmentTweak
}
2020-11-30 03:12:44 +03:00
// NoGossipThrottle returns true if gossip updates shouldn't be throttled.
func ( l * LegacyProtocol ) NoGossipThrottle ( ) bool {
return l . NoGossipUpdateThrottle
}