Fix pagination on /mining/blocks

This commit is contained in:
nymkappa
2022-03-15 23:49:20 +01:00
parent 622e0058f3
commit 671c25870c
3 changed files with 7 additions and 7 deletions

View File

@@ -659,7 +659,8 @@ class Routes {
public async getBlocksExtras(req: Request, res: Response) {
try {
res.json(await blocks.$getBlocksExtras(parseInt(req.params.height, 10), 15));
const height = req.params.height === undefined ? undefined : parseInt(req.params.height, 10);
res.json(await blocks.$getBlocksExtras(height, 15));
} catch (e) {
res.status(500).send(e instanceof Error ? e.message : e);
}