Skip to content

Commit d2a711d

Browse files
committed
staticaddr: show swap amount in listswaps command
1 parent 67d08f0 commit d2a711d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

loopd/swapclient_server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1767,13 +1767,18 @@ func (s *swapClientServer) ListStaticAddressSwaps(ctx context.Context,
17671767
return nil, fmt.Errorf("error decoding swap invoice: "+
17681768
"%v", err)
17691769
}
1770+
1771+
swapAmount := swp.TotalDepositAmount()
1772+
if swp.SelectedAmount > 0 {
1773+
swapAmount = swp.SelectedAmount
1774+
}
17701775
swap := &looprpc.StaticAddressLoopInSwap{
17711776
SwapHash: swp.SwapHash[:],
17721777
DepositOutpoints: swp.DepositOutpoints,
17731778
State: toClientStaticAddressLoopInState(
17741779
swp.GetState(),
17751780
),
1776-
SwapAmountSatoshis: int64(swp.TotalDepositAmount()),
1781+
SwapAmountSatoshis: int64(swapAmount),
17771782
PaymentRequestAmountSatoshis: int64(
17781783
swapPayReq.MilliSat.ToSatoshis(),
17791784
),

0 commit comments

Comments
 (0)