Merge branch 'master' into mining-api-docs

This commit is contained in:
wiz 2022-05-20 01:05:43 +09:00 committed by GitHub
commit dae9af7864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -723,6 +723,7 @@ class Routes {
public async getBlocksExtras(req: Request, res: Response) {
try {
const height = req.params.height === undefined ? undefined : parseInt(req.params.height, 10);
res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString());
res.json(await blocks.$getBlocksExtras(height, 15));
} catch (e) {
res.status(500).send(e instanceof Error ? e.message : e);
@ -1002,6 +1003,7 @@ class Routes {
public async $getRewardStats(req: Request, res: Response) {
try {
const response = await mining.$getRewardStats(parseInt(req.params.blockCount, 10));
res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString());
res.json(response);
} catch (e) {
res.status(500).end();