Return HTTP 503 from Fee Api when mempool is still syncing.

Fix for displaying git commit on About page.
This commit is contained in:
softsimon
2020-08-12 13:33:58 +07:00
parent dd0b67716f
commit 2d02ec7092
8 changed files with 54 additions and 48 deletions

View File

@@ -57,6 +57,11 @@ class Routes {
}
public async getRecommendedFees(req: Request, res: Response) {
if (!mempool.isInSync()) {
res.statusCode = 503;
res.send('Service Unavailable');
return;
}
const result = feeApi.getRecommendedFee();
res.json(result);
}