multi: remove x/exp/maps dependency

This commit is contained in:
jike authored and jike2021 committed 2025-03-25 10:34:19 +08:00
1 parent 67d2eac437
commit e72caf7b45
7 files changed
+22 -13

No files matched your search

+3 -2
View File
@@ -4,6 +4,8 @@ import (
"encoding/hex"
"errors"
"fmt"
"maps"
"slices"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
@@ -14,7 +16,6 @@ import (
"github.com/lightningnetwork/lnd/fn/v2"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
"golang.org/x/exp/maps"
)
var (
@@ -222,7 +223,7 @@ func UnmarshallCoinSelectionStrategy(strategy CoinSelectionStrategy,
// used in various RPCs that handle scid alias mappings.
func MarshalAliasMap(scidMap aliasmgr.ScidAliasMap) []*AliasMap {
return fn.Map(
maps.Keys(scidMap),
slices.Collect(maps.Keys(scidMap)),
func(base lnwire.ShortChannelID) *AliasMap {
return &AliasMap{
BaseScid: base.ToUint64(),
+3 -2
View File
@@ -10,9 +10,11 @@ import (
"encoding/binary"
"errors"
"fmt"
"maps"
"math"
"os"
"path/filepath"
"slices"
"sort"
"time"
@@ -43,7 +45,6 @@ import (
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
"github.com/lightningnetwork/lnd/macaroons"
"github.com/lightningnetwork/lnd/sweep"
"golang.org/x/exp/maps"
"google.golang.org/grpc"
"gopkg.in/macaroon-bakery.v2/bakery"
)
@@ -1269,7 +1270,7 @@ func (w *WalletKit) BumpForceCloseFee(_ context.Context,
err)
}
pendingSweeps := maps.Values(inputsMap)
pendingSweeps := slices.Collect(maps.Values(inputsMap))
// Discard everything except for the anchor sweeps.
anchors := fn.Filter(