|
5 | 5 | "fmt" |
6 | 6 | "sync" |
7 | 7 |
|
8 | | - "github.com/lightningnetwork/lnd/fn" |
| 8 | + "github.com/lightningnetwork/lnd/fn/v2" |
9 | 9 | "github.com/lightningnetwork/lnd/htlcswitch/hop" |
10 | 10 | "github.com/lightningnetwork/lnd/kvdb" |
11 | 11 | "github.com/lightningnetwork/lnd/lnwire" |
@@ -432,9 +432,9 @@ func (m *Manager) DeleteLocalAlias(alias, |
432 | 432 | } |
433 | 433 |
|
434 | 434 | // We'll filter the alias set and remove the alias from it. |
435 | | - aliasSet = fn.Filter(func(a lnwire.ShortChannelID) bool { |
| 435 | + aliasSet = fn.Filter(aliasSet, func(a lnwire.ShortChannelID) bool { |
436 | 436 | return a.ToUint64() != alias.ToUint64() |
437 | | - }, aliasSet) |
| 437 | + }) |
438 | 438 |
|
439 | 439 | // If the alias set is empty, we'll delete the base SCID from the |
440 | 440 | // baseToSet map. |
@@ -514,11 +514,17 @@ func (m *Manager) RequestAlias() (lnwire.ShortChannelID, error) { |
514 | 514 | // haveAlias returns true if the passed alias is already assigned to a |
515 | 515 | // channel in the baseToSet map. |
516 | 516 | haveAlias := func(maybeNextAlias lnwire.ShortChannelID) bool { |
517 | | - return fn.Any(func(aliasList []lnwire.ShortChannelID) bool { |
518 | | - return fn.Any(func(alias lnwire.ShortChannelID) bool { |
519 | | - return alias == maybeNextAlias |
520 | | - }, aliasList) |
521 | | - }, maps.Values(m.baseToSet)) |
| 517 | + return fn.Any( |
| 518 | + maps.Values(m.baseToSet), |
| 519 | + func(aliasList []lnwire.ShortChannelID) bool { |
| 520 | + return fn.Any( |
| 521 | + aliasList, |
| 522 | + func(alias lnwire.ShortChannelID) bool { |
| 523 | + return alias == maybeNextAlias |
| 524 | + }, |
| 525 | + ) |
| 526 | + }, |
| 527 | + ) |
522 | 528 | } |
523 | 529 |
|
524 | 530 | err := kvdb.Update(m.backend, func(tx kvdb.RwTx) error { |
|
0 commit comments