Skip to content

Commit 4f9c941

Browse files
committed
staticaddr: add static addr to withdrawn deposits
1 parent a74a290 commit 4f9c941

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
@@ -1851,9 +1851,19 @@ func (s *swapClientServer) ListStaticAddressWithdrawals(ctx context.Context,
18511851
clientWithdrawals := make(
18521852
[]*looprpc.StaticAddressWithdrawal, 0, len(withdrawals),
18531853
)
1854+
network, err := s.network.ChainParams()
1855+
if err != nil {
1856+
return nil, err
1857+
}
18541858
for _, w := range withdrawals {
18551859
deposits := make([]*looprpc.Deposit, 0, len(w.Deposits))
18561860
for _, d := range w.Deposits {
1861+
staticAddress, err := d.AddressParams.TaprootAddress(
1862+
network,
1863+
)
1864+
if err != nil {
1865+
return nil, err
1866+
}
18571867
deposits = append(deposits, &looprpc.Deposit{
18581868
Id: d.ID[:],
18591869
Outpoint: d.OutPoint.String(),
@@ -1862,6 +1872,7 @@ func (s *swapClientServer) ListStaticAddressWithdrawals(ctx context.Context,
18621872
State: toClientDepositState(
18631873
d.GetState(),
18641874
),
1875+
StaticAddress: staticAddress,
18651876
})
18661877
}
18671878
withdrawal := &looprpc.StaticAddressWithdrawal{

0 commit comments

Comments
 (0)