Skip to content

Commit bba8cac

Browse files
committed
staticaddr: add static addr to withdrawn deposits
1 parent bfe6dc4 commit bba8cac

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
@@ -1840,9 +1840,19 @@ func (s *swapClientServer) ListStaticAddressWithdrawals(ctx context.Context,
18401840
clientWithdrawals := make(
18411841
[]*looprpc.StaticAddressWithdrawal, 0, len(withdrawals),
18421842
)
1843+
network, err := s.network.ChainParams()
1844+
if err != nil {
1845+
return nil, err
1846+
}
18431847
for _, w := range withdrawals {
18441848
deposits := make([]*looprpc.Deposit, 0, len(w.Deposits))
18451849
for _, d := range w.Deposits {
1850+
staticAddress, err := d.AddressParams.TaprootAddress(
1851+
network,
1852+
)
1853+
if err != nil {
1854+
return nil, err
1855+
}
18461856
deposits = append(deposits, &looprpc.Deposit{
18471857
Id: d.ID[:],
18481858
Outpoint: d.OutPoint.String(),
@@ -1851,6 +1861,7 @@ func (s *swapClientServer) ListStaticAddressWithdrawals(ctx context.Context,
18511861
State: toClientDepositState(
18521862
d.GetState(),
18531863
),
1864+
StaticAddress: staticAddress,
18541865
})
18551866
}
18561867
withdrawal := &looprpc.StaticAddressWithdrawal{

0 commit comments

Comments
 (0)