routerrpc+record: move custom set validation

This commit is contained in:
Joost Jager committed 2019-12-12 17:49:34 +01:00
1 parent 75b94dec2b
commit d16476e477
3 files changed
+26 -26

No files matched your search

+3 -5
View File
@@ -3162,13 +3162,11 @@ func (r *rpcServer) extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPayme
}
payIntent.cltvLimit = cltvLimit
err = routerrpc.ValidateCustomRecords(
rpcPayReq.DestCustomRecords,
)
if err != nil {
customRecords := record.CustomSet(rpcPayReq.DestCustomRecords)
if err := customRecords.Validate(); err != nil {
return payIntent, err
}
payIntent.destCustomRecords = rpcPayReq.DestCustomRecords
payIntent.destCustomRecords = customRecords
validateDest := func(dest route.Vertex) error {
if rpcPayReq.AllowSelfPayment {