Skip to content

Commit ece0f76

Browse files
committed
loop: update listswaps api
1 parent efb6f75 commit ece0f76

File tree

4 files changed

+373
-322
lines changed

4 files changed

+373
-322
lines changed

loopd/swapclient_server.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ func (s *swapClientServer) marshallSwap(loopSwap *loop.SwapInfo) (
220220

221221
var swapType clientrpc.SwapType
222222
var htlcAddress, htlcAddressP2WSH, htlcAddressNP2WSH string
223+
var outGoingChanSet []uint64
224+
var lastHop []byte
223225

224226
switch loopSwap.SwapType {
225227
case swap.TypeIn:
@@ -233,11 +235,17 @@ func (s *swapClientServer) marshallSwap(loopSwap *loop.SwapInfo) (
233235
htlcAddress = htlcAddressP2WSH
234236
}
235237

238+
if loopSwap.LastHop != nil {
239+
lastHop = loopSwap.LastHop[:]
240+
}
241+
236242
case swap.TypeOut:
237243
swapType = clientrpc.SwapType_LOOP_OUT
238244
htlcAddressP2WSH = loopSwap.HtlcAddressP2WSH.EncodeAddress()
239245
htlcAddress = htlcAddressP2WSH
240246

247+
outGoingChanSet = loopSwap.OutgoingChanSet
248+
241249
default:
242250
return nil, errors.New("unknown swap type")
243251
}
@@ -258,6 +266,8 @@ func (s *swapClientServer) marshallSwap(loopSwap *loop.SwapInfo) (
258266
CostOnchain: int64(loopSwap.Cost.Onchain),
259267
CostOffchain: int64(loopSwap.Cost.Offchain),
260268
Label: loopSwap.Label,
269+
LastHop: lastHop,
270+
OutgoingChanSet: outGoingChanSet,
261271
}, nil
262272
}
263273

0 commit comments

Comments
 (0)