File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -49,12 +49,27 @@ func viewOut(swapClient *loop.Client, chainParams *chaincfg.Params) error {
4949 }
5050
5151 for _ , s := range swaps {
52+ scriptVersion := loop .GetHtlcScriptVersion (
53+ s .Contract .ProtocolVersion ,
54+ )
55+
56+ var outputType swap.HtlcOutputType
57+ switch scriptVersion {
58+ case swap .HtlcV1 :
59+ outputType = swap .HtlcNP2WSH
60+
61+ case swap .HtlcV2 :
62+ outputType = swap .HtlcP2WSH
63+
64+ case swap .HtlcV3 :
65+ outputType = swap .HtlcP2TR
66+ }
5267 htlc , err := swap .NewHtlc (
5368 loop .GetHtlcScriptVersion (s .Contract .ProtocolVersion ),
5469 s .Contract .CltvExpiry ,
5570 s .Contract .SenderKey ,
5671 s .Contract .ReceiverKey ,
57- s .Hash , swap . HtlcP2WSH , chainParams ,
72+ s .Hash , outputType , chainParams ,
5873 )
5974 if err != nil {
6075 return err
@@ -106,7 +121,7 @@ func viewIn(swapClient *loop.Client, chainParams *chaincfg.Params) error {
106121 s .Contract .CltvExpiry ,
107122 s .Contract .SenderKey ,
108123 s .Contract .ReceiverKey ,
109- s .Hash , swap .HtlcNP2WSH , chainParams ,
124+ s .Hash , swap .HtlcP2WSH , chainParams ,
110125 )
111126 if err != nil {
112127 return err
You can’t perform that action at this time.
0 commit comments