From 936bb851f22da05e9185f04c8bb75c9be77f0f1c Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Tue, 12 May 2020 18:51:42 +0200 Subject: [PATCH] loopin: fix htlc address in LoopIn SwapResponse --- loopd/swapclient_server.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/loopd/swapclient_server.go b/loopd/swapclient_server.go index 8cf1754..4f9d9a1 100644 --- a/loopd/swapclient_server.go +++ b/loopd/swapclient_server.go @@ -434,16 +434,17 @@ func (s *swapClientServer) LoopIn(ctx context.Context, return nil, err } - np2wshAddress := swapInfo.HtlcAddressNP2WSH.String() response := &looprpc.SwapResponse{ - Id: swapInfo.SwapHash.String(), - IdBytes: swapInfo.SwapHash[:], - HtlcAddress: np2wshAddress, - HtlcAddressNp2Wsh: np2wshAddress, + Id: swapInfo.SwapHash.String(), + IdBytes: swapInfo.SwapHash[:], + HtlcAddressP2Wsh: swapInfo.HtlcAddressP2WSH.String(), } if req.ExternalHtlc { - response.HtlcAddressP2Wsh = swapInfo.HtlcAddressP2WSH.String() + response.HtlcAddressNp2Wsh = swapInfo.HtlcAddressNP2WSH.String() + response.HtlcAddress = response.HtlcAddressNp2Wsh + } else { + response.HtlcAddress = response.HtlcAddressP2Wsh } return response, nil