routerrpc+record: move custom set validation

This commit is contained in:
Joost Jager
2019-12-12 14:43:36 +01:00
parent 75b94dec2b
commit d16476e477
3 changed files with 26 additions and 26 deletions

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 {