Skip to content

Commit db934a8

Browse files
committed
staticaddr: show swap amount in listswaps command
1 parent 1f2417c commit db934a8

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
@@ -1758,13 +1758,18 @@ func (s *swapClientServer) ListStaticAddressSwaps(ctx context.Context,
17581758
return nil, fmt.Errorf("error decoding swap invoice: "+
17591759
"%v", err)
17601760
}
1761+
1762+
swapAmount := swp.TotalDepositAmount()
1763+
if swp.SelectedAmount > 0 {
1764+
swapAmount = swp.SelectedAmount
1765+
}
17611766
swap := &looprpc.StaticAddressLoopInSwap{
17621767
SwapHash: swp.SwapHash[:],
17631768
DepositOutpoints: swp.DepositOutpoints,
17641769
State: toClientStaticAddressLoopInState(
17651770
swp.GetState(),
17661771
),
1767-
SwapAmountSatoshis: int64(swp.TotalDepositAmount()),
1772+
SwapAmountSatoshis: int64(swapAmount),
17681773
PaymentRequestAmountSatoshis: int64(
17691774
swapPayReq.MilliSat.ToSatoshis(),
17701775
),

0 commit comments

Comments
 (0)