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:
8 files changed
+600
-225
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user