From 9c940746a748ab759e2f17957d825695c4f3ff42 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 6 Feb 2019 15:48:23 -0800 Subject: [PATCH] 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. --- rpcserver.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcserver.go b/rpcserver.go index b4326ca62..e13aabe1f 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -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