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:
6 files changed
+63
-13
No files matched your search
@@ -1713,8 +1713,13 @@ func (s *Server) XAddLocalChanAliases(_ context.Context,
|
||||
rpcAlias)
|
||||
}
|
||||
|
||||
// We set the baseLookup flag as we want the alias
|
||||
// manager to keep a mapping from the alias back to its
|
||||
// base scid, in order to be able to provide it via the
|
||||
// FindBaseLocalChanAlias RPC.
|
||||
err = s.cfg.AliasMgr.AddLocalAlias(
|
||||
aliasScid, baseScid, false, true,
|
||||
aliasmgr.WithBaseLookup(),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error adding scid "+
|
||||
|
||||
Reference in new issue
Block a user