github.com/decred/dcrlnd@v0.7.6/lncfg/protocol_legacy_on.go (about)

     1  //go:build dev
     2  // +build dev
     3  
     4  package lncfg
     5  
     6  // Legacy is a sub-config that houses all the legacy protocol options.  These
     7  // are mostly used for integration tests as most modern nodes shuld always run
     8  // with them on by default.
     9  type LegacyProtocol struct {
    10  	// LegacyOnionFormat if set to true, then we won't signal
    11  	// TLVOnionPayloadOptional. As a result, nodes that include us in the
    12  	// route won't use the new modern onion framing.
    13  	LegacyOnionFormat bool `long:"onion" description:"force node to not advertise the new modern TLV onion format"`
    14  
    15  	// CommitmentTweak guards if we should use the old legacy commitment
    16  	// protocol, or the newer variant that doesn't have a tweak for the
    17  	// remote party's output in the commitment. If set to true, then we
    18  	// won't signal StaticRemoteKeyOptional.
    19  	CommitmentTweak bool `long:"committweak" description:"force node to not advertise the new commitment format"`
    20  }
    21  
    22  // LegacyOnion returns true if the old legacy onion format should be used when
    23  // we're an intermediate or final hop. This controls if we set the
    24  // TLVOnionPayloadOptional bit or not.
    25  func (l *LegacyProtocol) LegacyOnion() bool {
    26  	return l.LegacyOnionFormat
    27  }
    28  
    29  // NoStaticRemoteKey returns true if the old commitment format with a tweaked
    30  // remote key should be used for new funded channels.
    31  func (l *LegacyProtocol) NoStaticRemoteKey() bool {
    32  	return l.CommitmentTweak
    33  }