@@ -1707,6 +1707,11 @@ func (s *swapClientServer) ListStaticAddressDeposits(ctx context.Context,
1707
1707
return nil , err
1708
1708
}
1709
1709
1710
+ network , err := s .network .ChainParams ()
1711
+ if err != nil {
1712
+ return nil , err
1713
+ }
1714
+
1710
1715
// Deposits filtered by state or outpoints.
1711
1716
var filteredDeposits []* looprpc.Deposit
1712
1717
if len (outpoints ) > 0 {
@@ -1718,7 +1723,7 @@ func (s *swapClientServer) ListStaticAddressDeposits(ctx context.Context,
1718
1723
}
1719
1724
return false
1720
1725
}
1721
- filteredDeposits = filter (allDeposits , f )
1726
+ filteredDeposits = filter (allDeposits , network , f )
1722
1727
1723
1728
if len (outpoints ) != len (filteredDeposits ) {
1724
1729
return nil , fmt .Errorf ("not all outpoints found in " +
@@ -1734,7 +1739,7 @@ func (s *swapClientServer) ListStaticAddressDeposits(ctx context.Context,
1734
1739
1735
1740
return d .IsInState (toServerState (req .StateFilter ))
1736
1741
}
1737
- filteredDeposits = filter (allDeposits , f )
1742
+ filteredDeposits = filter (allDeposits , network , f )
1738
1743
}
1739
1744
1740
1745
// Calculate the blocks until expiry for each deposit.
@@ -2107,7 +2112,9 @@ func (s *swapClientServer) StaticAddressLoopIn(ctx context.Context,
2107
2112
2108
2113
type filterFunc func (deposits * deposit.Deposit ) bool
2109
2114
2110
- func filter (deposits []* deposit.Deposit , f filterFunc ) []* looprpc.Deposit {
2115
+ func filter (deposits []* deposit.Deposit , network * chaincfg.Params ,
2116
+ f filterFunc ) []* looprpc.Deposit {
2117
+
2111
2118
var clientDeposits []* looprpc.Deposit
2112
2119
for _ , d := range deposits {
2113
2120
if ! f (d ) {
@@ -2121,6 +2128,7 @@ func filter(deposits []*deposit.Deposit, f filterFunc) []*looprpc.Deposit {
2121
2128
2122
2129
hash := d .Hash
2123
2130
outpoint := wire .NewOutPoint (& hash , d .Index ).String ()
2131
+ staticAddr , _ := d .AddressParams .TaprootAddress (network )
2124
2132
deposit := & looprpc.Deposit {
2125
2133
Id : d .ID [:],
2126
2134
State : toClientDepositState (
@@ -2130,6 +2138,7 @@ func filter(deposits []*deposit.Deposit, f filterFunc) []*looprpc.Deposit {
2130
2138
Value : int64 (d .Value ),
2131
2139
ConfirmationHeight : d .ConfirmationHeight ,
2132
2140
SwapHash : swapHash ,
2141
+ StaticAddress : staticAddr ,
2133
2142
}
2134
2143
2135
2144
clientDeposits = append (clientDeposits , deposit )
0 commit comments