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 {
117
117
118
118
// KeySend is set to true if the tlv payload will include the preimage.
119
119
KeySend bool
120
+
121
+ // CustomRecords holds the custom TLV records that will be added to the
122
+ // payment.
123
+ CustomRecords map [uint64 ][]byte
120
124
}
121
125
122
126
// routerClient is a wrapper around the generated routerrpc proxy.
@@ -154,6 +158,9 @@ func (r *routerClient) SendPayment(ctx context.Context,
154
158
if request .LastHopPubkey != nil {
155
159
rpcReq .LastHopPubkey = request .LastHopPubkey [:]
156
160
}
161
+
162
+ rpcReq .DestCustomRecords = request .CustomRecords
163
+
157
164
if request .KeySend {
158
165
if request .PaymentHash != nil {
159
166
return nil , nil , fmt .Errorf (
@@ -165,10 +172,12 @@ func (r *routerClient) SendPayment(ctx context.Context,
165
172
return nil , nil , err
166
173
}
167
174
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 )
171
177
}
178
+
179
+ // Override the payment hash.
180
+ rpcReq .DestCustomRecords [record .KeySendType ] = preimage [:]
172
181
hash := preimage .Hash ()
173
182
request .PaymentHash = & hash
174
183
}
You can’t perform that action at this time.
0 commit comments