Skip to content

Commit ac28d28

Browse files
committed
staticaddr: show swap amount in listswaps command
1 parent fddc3f4 commit ac28d28

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
@@ -1778,13 +1778,18 @@ func (s *swapClientServer) ListStaticAddressSwaps(ctx context.Context,
17781778
return nil, fmt.Errorf("error decoding swap invoice: "+
17791779
"%v", err)
17801780
}
1781+
1782+
swapAmount := swp.TotalDepositAmount()
1783+
if swp.SelectedAmount > 0 {
1784+
swapAmount = swp.SelectedAmount
1785+
}
17811786
swap := &looprpc.StaticAddressLoopInSwap{
17821787
SwapHash: swp.SwapHash[:],
17831788
DepositOutpoints: swp.DepositOutpoints,
17841789
State: toClientStaticAddressLoopInState(
17851790
swp.GetState(),
17861791
),
1787-
SwapAmountSatoshis: int64(swp.TotalDepositAmount()),
1792+
SwapAmountSatoshis: int64(swapAmount),
17881793
PaymentRequestAmountSatoshis: int64(
17891794
swapPayReq.MilliSat.ToSatoshis(),
17901795
),

0 commit comments

Comments
 (0)