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

+25
View File
@@ -597,4 +597,29 @@ func RegisterRouterJSONCallbacks(registry map[string]func(ctx context.Context,
}
callback(string(respBytes), nil)
}
registry["routerrpc.Router.XFindBaseLocalChanAlias"] = func(ctx context.Context,
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {
req := &FindBaseAliasRequest{}
err := marshaler.Unmarshal([]byte(reqJSON), req)
if err != nil {
callback("", err)
return
}
client := NewRouterClient(conn)
resp, err := client.XFindBaseLocalChanAlias(ctx, req)
if err != nil {
callback("", err)
return
}
respBytes, err := marshaler.Marshal(resp)
if err != nil {
callback("", err)
return
}
callback(string(respBytes), nil)
}
}