Skip to content

Commit 5e1c9cf

Browse files
committed
staticaddr: show swap amount in listswaps command
1 parent de351a3 commit 5e1c9cf

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
@@ -1731,13 +1731,18 @@ func (s *swapClientServer) ListStaticAddressSwaps(ctx context.Context,
17311731
return nil, fmt.Errorf("error decoding swap invoice: "+
17321732
"%v", err)
17331733
}
1734+
1735+
swapAmount := swp.TotalDepositAmount()
1736+
if swp.SelectedAmount > 0 {
1737+
swapAmount = swp.SelectedAmount
1738+
}
17341739
swap := &looprpc.StaticAddressLoopInSwap{
17351740
SwapHash: swp.SwapHash[:],
17361741
DepositOutpoints: swp.DepositOutpoints,
17371742
State: toClientStaticAddressLoopInState(
17381743
swp.GetState(),
17391744
),
1740-
SwapAmountSatoshis: int64(swp.TotalDepositAmount()),
1745+
SwapAmountSatoshis: int64(swapAmount),
17411746
PaymentRequestAmountSatoshis: int64(
17421747
swapPayReq.MilliSat.ToSatoshis(),
17431748
),

0 commit comments

Comments
 (0)