Skip to content

Commit 21fb9ac

Browse files
committed
staticaddr: show swap amount in listswaps command
1 parent 387c103 commit 21fb9ac

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
@@ -1670,13 +1670,18 @@ func (s *swapClientServer) ListStaticAddressSwaps(ctx context.Context,
16701670
return nil, fmt.Errorf("error decoding swap invoice: "+
16711671
"%v", err)
16721672
}
1673+
1674+
swapAmount := swp.TotalDepositAmount()
1675+
if swp.SelectedAmount > 0 {
1676+
swapAmount = swp.SelectedAmount
1677+
}
16731678
swap := &looprpc.StaticAddressLoopInSwap{
16741679
SwapHash: swp.SwapHash[:],
16751680
DepositOutpoints: swp.DepositOutpoints,
16761681
State: toClientStaticAddressLoopInState(
16771682
swp.GetState(),
16781683
),
1679-
SwapAmountSatoshis: int64(swp.TotalDepositAmount()),
1684+
SwapAmountSatoshis: int64(swapAmount),
16801685
PaymentRequestAmountSatoshis: int64(
16811686
swapPayReq.MilliSat.ToSatoshis(),
16821687
),

0 commit comments

Comments
 (0)