Skip to content

Commit 3449b29

Browse files
committed
staticaddr: add static addr to withdrawn deposits
1 parent f615ea7 commit 3449b29

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
@@ -1847,9 +1847,19 @@ func (s *swapClientServer) ListStaticAddressWithdrawals(ctx context.Context,
18471847
clientWithdrawals := make(
18481848
[]*looprpc.StaticAddressWithdrawal, 0, len(withdrawals),
18491849
)
1850+
network, err := s.network.ChainParams()
1851+
if err != nil {
1852+
return nil, err
1853+
}
18501854
for _, w := range withdrawals {
18511855
deposits := make([]*looprpc.Deposit, 0, len(w.Deposits))
18521856
for _, d := range w.Deposits {
1857+
staticAddress, err := d.AddressParams.TaprootAddress(
1858+
network,
1859+
)
1860+
if err != nil {
1861+
return nil, err
1862+
}
18531863
deposits = append(deposits, &looprpc.Deposit{
18541864
Id: d.ID[:],
18551865
Outpoint: d.OutPoint.String(),
@@ -1858,6 +1868,7 @@ func (s *swapClientServer) ListStaticAddressWithdrawals(ctx context.Context,
18581868
State: toClientDepositState(
18591869
d.GetState(),
18601870
),
1871+
StaticAddress: staticAddress,
18611872
})
18621873
}
18631874
withdrawal := &looprpc.StaticAddressWithdrawal{

0 commit comments

Comments
 (0)