Skip to content

Commit 6b66a63

Browse files
committed
staticaddr: add static addr to withdrawn deposits
1 parent ff5dd30 commit 6b66a63

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

loopd/swapclient_server.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,9 +1850,19 @@ func (s *swapClientServer) ListStaticAddressWithdrawals(ctx context.Context,
18501850
clientWithdrawals := make(
18511851
[]*looprpc.StaticAddressWithdrawal, 0, len(withdrawals),
18521852
)
1853+
network, err := s.network.ChainParams()
1854+
if err != nil {
1855+
return nil, err
1856+
}
18531857
for _, w := range withdrawals {
18541858
deposits := make([]*looprpc.Deposit, 0, len(w.Deposits))
18551859
for _, d := range w.Deposits {
1860+
staticAddress, err := d.AddressParams.TaprootAddress(
1861+
network,
1862+
)
1863+
if err != nil {
1864+
return nil, err
1865+
}
18561866
deposits = append(deposits, &looprpc.Deposit{
18571867
Id: d.ID[:],
18581868
Outpoint: d.OutPoint.String(),
@@ -1861,6 +1871,7 @@ func (s *swapClientServer) ListStaticAddressWithdrawals(ctx context.Context,
18611871
State: toClientDepositState(
18621872
d.GetState(),
18631873
),
1874+
StaticAddress: staticAddress,
18641875
})
18651876
}
18661877
withdrawal := &looprpc.StaticAddressWithdrawal{

0 commit comments

Comments
 (0)