lnrpc: add XFindBaseLocalChanAlias rpc

Add the new RPC method that looks up the base scid for a given alias.
Given the previous stepping stones this commit is fairly simple, we just
call into the alias manager and return the lookup result.
This commit is contained in:
George Tsagkarelis committed 2025-09-25 11:15:31 +02:00
1 parent 472a2f967e
commit f14190c02d
8 files changed
+600 -225

No files matched your search

+16
View File
@@ -1764,6 +1764,22 @@ func (s *Server) XDeleteLocalChanAliases(_ context.Context,
}, nil
}
// XFindBaseLocalChanAlias is an experimental API that looks up the base scid
// for a local chan alias that was registered.
func (s *Server) XFindBaseLocalChanAlias(_ context.Context,
in *FindBaseAliasRequest) (*FindBaseAliasResponse, error) {
aliasScid := lnwire.NewShortChanIDFromInt(in.Alias)
base, err := s.cfg.AliasMgr.FindBaseSCID(aliasScid)
if err != nil {
return nil, err
}
return &FindBaseAliasResponse{
Base: base.ToUint64(),
}, nil
}
func extractOutPoint(req *UpdateChanStatusRequest) (*wire.OutPoint, error) {
chanPoint := req.GetChanPoint()
txid, err := lnrpc.GetChanPointFundingTxid(chanPoint)