File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ type SendPaymentRequest struct {
117117
118118 // KeySend is set to true if the tlv payload will include the preimage.
119119 KeySend bool
120+
121+ // CustomRecords holds the custom TLV records that will be added to the
122+ // payment.
123+ CustomRecords map [uint64 ][]byte
120124}
121125
122126// routerClient is a wrapper around the generated routerrpc proxy.
@@ -154,6 +158,9 @@ func (r *routerClient) SendPayment(ctx context.Context,
154158 if request .LastHopPubkey != nil {
155159 rpcReq .LastHopPubkey = request .LastHopPubkey [:]
156160 }
161+
162+ rpcReq .DestCustomRecords = request .CustomRecords
163+
157164 if request .KeySend {
158165 if request .PaymentHash != nil {
159166 return nil , nil , fmt .Errorf (
@@ -165,10 +172,12 @@ func (r *routerClient) SendPayment(ctx context.Context,
165172 return nil , nil , err
166173 }
167174
168- // Override the payment hash.
169- rpcReq .DestCustomRecords = map [uint64 ][]byte {
170- record .KeySendType : preimage [:],
175+ if rpcReq .DestCustomRecords == nil {
176+ rpcReq .DestCustomRecords = make (map [uint64 ][]byte )
171177 }
178+
179+ // Override the payment hash.
180+ rpcReq .DestCustomRecords [record .KeySendType ] = preimage [:]
172181 hash := preimage .Hash ()
173182 request .PaymentHash = & hash
174183 }
You can’t perform that action at this time.
0 commit comments