Skip to content

Commit bb29e7d

Browse files
committed
staticaddr: fix swap amount in listswaps command
1 parent bcc0d5f commit bb29e7d

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
@@ -1812,13 +1812,18 @@ func (s *swapClientServer) ListStaticAddressSwaps(ctx context.Context,
18121812
return nil, fmt.Errorf("error decoding swap invoice: "+
18131813
"%v", err)
18141814
}
1815+
1816+
swapAmount := swp.TotalDepositAmount()
1817+
if swp.SelectedAmount > 0 {
1818+
swapAmount = swp.SelectedAmount
1819+
}
18151820
swap := &looprpc.StaticAddressLoopInSwap{
18161821
SwapHash: swp.SwapHash[:],
18171822
DepositOutpoints: swp.DepositOutpoints,
18181823
State: toClientStaticAddressLoopInState(
18191824
swp.GetState(),
18201825
),
1821-
SwapAmountSatoshis: int64(swp.TotalDepositAmount()),
1826+
SwapAmountSatoshis: int64(swapAmount),
18221827
PaymentRequestAmountSatoshis: int64(
18231828
swapPayReq.MilliSat.ToSatoshis(),
18241829
),

0 commit comments

Comments
 (0)