@@ -58,19 +58,22 @@ type ErrorEncrypter interface {
5858 // encrypted opaque failure reason. This method will be used at the
5959 // source that the error occurs. It differs from IntermediateEncrypt
6060 // slightly, in that it computes a proper MAC over the error.
61- EncryptFirstHop (lnwire.FailureMessage ) (lnwire.OpaqueReason , error )
61+ EncryptFirstHop (lnwire.FailureMessage ) (lnwire.OpaqueReason , []byte ,
62+ error )
6263
6364 // EncryptMalformedError is similar to EncryptFirstHop (it adds the
6465 // MAC), but it accepts an opaque failure reason rather than a failure
6566 // message. This method is used when we receive an
6667 // UpdateFailMalformedHTLC from the remote peer and then need to
6768 // convert that into a proper error from only the raw bytes.
68- EncryptMalformedError (lnwire.OpaqueReason ) (lnwire.OpaqueReason , error )
69+ EncryptMalformedError (lnwire.OpaqueReason ) (lnwire.OpaqueReason , []byte ,
70+ error )
6971
7072 // IntermediateEncrypt wraps an already encrypted opaque reason error
7173 // in an additional layer of onion encryption. This process repeats
7274 // until the error arrives at the source of the payment.
73- IntermediateEncrypt (lnwire.OpaqueReason ) (lnwire.OpaqueReason , error )
75+ IntermediateEncrypt (lnwire.OpaqueReason , []byte ) (lnwire.OpaqueReason ,
76+ []byte , error )
7477
7578 // Type returns an enum indicating the underlying concrete instance
7679 // backing this interface.
@@ -123,16 +126,16 @@ func NewSphinxErrorEncrypter() *SphinxErrorEncrypter {
123126//
124127// NOTE: Part of the ErrorEncrypter interface.
125128func (s * SphinxErrorEncrypter ) EncryptFirstHop (
126- failure lnwire.FailureMessage ) (lnwire.OpaqueReason , error ) {
129+ failure lnwire.FailureMessage ) (lnwire.OpaqueReason , [] byte , error ) {
127130
128131 var b bytes.Buffer
129132 if err := lnwire .EncodeFailure (& b , failure , 0 ); err != nil {
130- return nil , err
133+ return nil , nil , err
131134 }
132135
133136 // We pass a true as the first parameter to indicate that a MAC should
134137 // be added.
135- return s .EncryptError (true , b .Bytes ()) , nil
138+ return s .EncryptError (true , b .Bytes (), nil , 0 )
136139}
137140
138141// EncryptMalformedError is similar to EncryptFirstHop (it adds the MAC), but
@@ -143,9 +146,9 @@ func (s *SphinxErrorEncrypter) EncryptFirstHop(
143146//
144147// NOTE: Part of the ErrorEncrypter interface.
145148func (s * SphinxErrorEncrypter ) EncryptMalformedError (
146- reason lnwire.OpaqueReason ) (lnwire.OpaqueReason , error ) {
149+ reason lnwire.OpaqueReason ) (lnwire.OpaqueReason , [] byte , error ) {
147150
148- return s .EncryptError (true , reason ) , nil
151+ return s .EncryptError (true , reason , nil , 0 )
149152}
150153
151154// IntermediateEncrypt wraps an already encrypted opaque reason error in an
@@ -156,9 +159,10 @@ func (s *SphinxErrorEncrypter) EncryptMalformedError(
156159//
157160// NOTE: Part of the ErrorEncrypter interface.
158161func (s * SphinxErrorEncrypter ) IntermediateEncrypt (
159- reason lnwire.OpaqueReason ) (lnwire.OpaqueReason , error ) {
162+ reason lnwire.OpaqueReason , _ []byte ) (lnwire.OpaqueReason , []byte ,
163+ error ) {
160164
161- return s .EncryptError (false , reason ) , nil
165+ return s .EncryptError (false , reason , nil , 0 )
162166}
163167
164168// Type returns the identifier for a sphinx error encrypter.
0 commit comments