Skip to content

Commit 8be2c65

Browse files
committed
staticaddr: show swap amount in listswaps command
1 parent cafd1eb commit 8be2c65

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
@@ -1723,13 +1723,18 @@ func (s *swapClientServer) ListStaticAddressSwaps(ctx context.Context,
17231723
return nil, fmt.Errorf("error decoding swap invoice: "+
17241724
"%v", err)
17251725
}
1726+
1727+
swapAmount := swp.TotalDepositAmount()
1728+
if swp.SelectedAmount > 0 {
1729+
swapAmount = swp.SelectedAmount
1730+
}
17261731
swap := &looprpc.StaticAddressLoopInSwap{
17271732
SwapHash: swp.SwapHash[:],
17281733
DepositOutpoints: swp.DepositOutpoints,
17291734
State: toClientStaticAddressLoopInState(
17301735
swp.GetState(),
17311736
),
1732-
SwapAmountSatoshis: int64(swp.TotalDepositAmount()),
1737+
SwapAmountSatoshis: int64(swapAmount),
17331738
PaymentRequestAmountSatoshis: int64(
17341739
swapPayReq.MilliSat.ToSatoshis(),
17351740
),

0 commit comments

Comments
 (0)