Skip to content

Commit 6e56817

Browse files
committed
staticaddr: show swap amount in listswaps command
1 parent d6fb023 commit 6e56817

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

loopd/swapclient_server.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -1724,13 +1724,18 @@ func (s *swapClientServer) ListStaticAddressSwaps(ctx context.Context,
17241724
return nil, fmt.Errorf("error decoding swap invoice: "+
17251725
"%v", err)
17261726
}
1727+
1728+
swapAmount := swp.TotalDepositAmount()
1729+
if swp.SelectedAmount > 0 {
1730+
swapAmount = swp.SelectedAmount
1731+
}
17271732
swap := &looprpc.StaticAddressLoopInSwap{
17281733
SwapHash: swp.SwapHash[:],
17291734
DepositOutpoints: swp.DepositOutpoints,
17301735
State: toClientStaticAddressLoopInState(
17311736
swp.GetState(),
17321737
),
1733-
SwapAmountSatoshis: int64(swp.TotalDepositAmount()),
1738+
SwapAmountSatoshis: int64(swapAmount),
17341739
PaymentRequestAmountSatoshis: int64(
17351740
swapPayReq.MilliSat.ToSatoshis(),
17361741
),

0 commit comments

Comments
 (0)