multi: add base lookup option to AddLocalAlias

We add an extra option to the AddLocalAlias method which only controls
whether we store a reverse lookup from the alias back to the base scid
it corresponds to. The previous flag "gossip" is still maintained, and
in a way supercedes the new flag (it will also store the base scid
lookup even if the base lookup flag isn't set). The only call that sets
this option is the XAddLocalChanAlias RPC endpoint, where we want to
make sure that a reverse lookup is stored in the alias manager in order
to later expose it via the new RPC method.
This commit is contained in:
George Tsagkarelis committed 2025-09-25 11:15:27 +02:00
1 parent f293566849
commit 472a2f967e
6 files changed
+63 -13

No files matched your search

+3 -2
View File
@@ -19,6 +19,7 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btclog/v2"
"github.com/lightningnetwork/lnd/aliasmgr"
"github.com/lightningnetwork/lnd/brontide"
"github.com/lightningnetwork/lnd/buffer"
"github.com/lightningnetwork/lnd/chainntnfs"
@@ -404,8 +405,8 @@ type Config struct {
RequestAlias func() (lnwire.ShortChannelID, error)
// AddLocalAlias persists an alias to an underlying alias store.
AddLocalAlias func(alias, base lnwire.ShortChannelID,
gossip, liveUpdate bool) error
AddLocalAlias func(alias, base lnwire.ShortChannelID, gossip,
liveUpdate bool, opts ...aliasmgr.AddLocalAliasOption) error
// AuxLeafStore is an optional store that can be used to store auxiliary
// leaves for certain custom channel types.