From 3d718bb9a33b8ae2e5331dcf986c0aa1ee7f5629 Mon Sep 17 00:00:00 2001 From: Roman Storm Date: Thu, 16 Jul 2020 18:45:40 -0700 Subject: [PATCH] add latest block --- src/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 6caad6c..36a28e8 100644 --- a/src/index.js +++ b/src/index.js @@ -37,8 +37,15 @@ app.get('/', function (req, res) { res.send('This is tornado.cash Relayer service. Check the /status for settings') }) + app.get('/status', async function (req, res) { let nonce = await redisClient.get('nonce') + let latestBlock = null + try { + latestBlock = await web3.eth.getBlockNumber() + } catch(e) { + console.error('Problem with RPC', e) + } const { ethPrices } = fetcher res.json({ relayerAddress: web3.eth.defaultAccount, @@ -48,7 +55,8 @@ app.get('/status', async function (req, res) { ethPrices, relayerServiceFee, nonce, - version + version, + latestBlock }) })