rpc: fix regression in SendToRouteSync payment hash parsing

A recent change in this area of the codebase refactored some code to
make way for the deprecation of the streaming multi-route `SendToRoute`
method. Along the way, it removed the parsing of the `PaymentHashString`
field for the sync `SendToRouteSync` which is meant to be used via the
REST interface. In this commit, we fix this by populating _both_
`PaymentHash` and `PaymentHashString`. This is OK, as
`extractPaymentIntent` will check both values to extract the hex-encoded
payment hash if it's specified.
This commit is contained in:
Olaoluwa Osuntokun 2019-02-06 15:48:23 -08:00
parent 27cfdf944e
commit 9c940746a7
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

View File

@ -2719,7 +2719,8 @@ func unmarshallSendToRouteRequest(req *lnrpc.SendToRouteRequest,
return &rpcPaymentRequest{
SendRequest: &lnrpc.SendRequest{
PaymentHash: req.PaymentHash,
PaymentHash: req.PaymentHash,
PaymentHashString: req.PaymentHashString,
},
routes: routes,
}, nil