File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,37 @@ func NewNonFinalBlindedRouteData(chanID lnwire.ShortChannelID,
9090 return info
9191}
9292
93+ // NewNonFinalBlindedRouteData creates the data that's provided for hops within
94+ // a blinded route.
95+ func NewNonFinalBlindedRouteDataOnionMessage (nextNodeID * btcec.PublicKey ,
96+ blindingOverride * btcec.PublicKey , constraints * PaymentConstraints ,
97+ features * lnwire.FeatureVector ) * BlindedRouteData {
98+
99+ info := & BlindedRouteData {
100+ NextNodeID : tlv .SomeRecordT (
101+ tlv.NewPrimitiveRecord [tlv.TlvType4 ](nextNodeID ),
102+ ),
103+ }
104+
105+ if blindingOverride != nil {
106+ info .NextBlindingOverride = tlv .SomeRecordT (
107+ tlv.NewPrimitiveRecord [tlv.TlvType8 ](blindingOverride ))
108+ }
109+
110+ if constraints != nil {
111+ info .Constraints = tlv .SomeRecordT (
112+ tlv.NewRecordT [tlv.TlvType12 ](* constraints ))
113+ }
114+
115+ if features != nil {
116+ info .Features = tlv .SomeRecordT (
117+ tlv.NewRecordT [tlv.TlvType14 ](* features ),
118+ )
119+ }
120+
121+ return info
122+ }
123+
93124// NewFinalHopBlindedRouteData creates the data that's provided for the final
94125// hop in a blinded route.
95126func NewFinalHopBlindedRouteData (constraints * PaymentConstraints ,
You can’t perform that action at this time.
0 commit comments