File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 99
1010 "github.com/btcsuite/btcd/btcec"
1111 "github.com/btcsuite/btcd/wire"
12+ "github.com/lightningnetwork/lnd/tlv"
1213)
1314
1415// HopData is the information destined for individual hops. It is a fixed size
@@ -210,7 +211,8 @@ func (hp *HopPayload) Encode(w io.Writer) error {
210211 // For the TLV payload, we'll first prepend the length of the payload
211212 // as a var-int.
212213 case PayloadTLV :
213- err := wire .WriteVarInt (w , 0 , uint64 (len (hp .Payload )))
214+ var b [8 ]byte
215+ err := tlv .WriteVarInt (w , uint64 (len (hp .Payload )), & b )
214216 if err != nil {
215217 return err
216218 }
@@ -254,7 +256,8 @@ func (hp *HopPayload) Decode(r io.Reader) error {
254256 default :
255257 // Otherwise, this is the new TLV based payload type, so we'll
256258 // extract the payload length encoded as a var-int.
257- varInt , err := wire .ReadVarInt (bufReader , 0 )
259+ var b [8 ]byte
260+ varInt , err := tlv .ReadVarInt (bufReader , & b )
258261 if err != nil {
259262 return err
260263 }
You can’t perform that action at this time.
0 commit comments