Skip to content

Commit 936bb85

Browse files
committed
loopin: fix htlc address in LoopIn SwapResponse
1 parent f36d5a7 commit 936bb85

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

loopd/swapclient_server.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,17 @@ func (s *swapClientServer) LoopIn(ctx context.Context,
434434
return nil, err
435435
}
436436

437-
np2wshAddress := swapInfo.HtlcAddressNP2WSH.String()
438437
response := &looprpc.SwapResponse{
439-
Id: swapInfo.SwapHash.String(),
440-
IdBytes: swapInfo.SwapHash[:],
441-
HtlcAddress: np2wshAddress,
442-
HtlcAddressNp2Wsh: np2wshAddress,
438+
Id: swapInfo.SwapHash.String(),
439+
IdBytes: swapInfo.SwapHash[:],
440+
HtlcAddressP2Wsh: swapInfo.HtlcAddressP2WSH.String(),
443441
}
444442

445443
if req.ExternalHtlc {
446-
response.HtlcAddressP2Wsh = swapInfo.HtlcAddressP2WSH.String()
444+
response.HtlcAddressNp2Wsh = swapInfo.HtlcAddressNP2WSH.String()
445+
response.HtlcAddress = response.HtlcAddressNp2Wsh
446+
} else {
447+
response.HtlcAddress = response.HtlcAddressP2Wsh
447448
}
448449

449450
return response, nil

0 commit comments

Comments
 (0)