add latest block

This commit is contained in:
Roman Storm 2020-07-16 18:45:40 -07:00
parent 1ac1b6c5ce
commit 3d718bb9a3
No known key found for this signature in database
GPG Key ID: 522F2A785F34E71F

@ -37,8 +37,15 @@ app.get('/', function (req, res) {
res.send('This is <a href=https://tornado.cash>tornado.cash</a> Relayer service. Check the <a href=/status>/status</a> for settings') res.send('This is <a href=https://tornado.cash>tornado.cash</a> Relayer service. Check the <a href=/status>/status</a> for settings')
}) })
app.get('/status', async function (req, res) { app.get('/status', async function (req, res) {
let nonce = await redisClient.get('nonce') 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 const { ethPrices } = fetcher
res.json({ res.json({
relayerAddress: web3.eth.defaultAccount, relayerAddress: web3.eth.defaultAccount,
@ -48,7 +55,8 @@ app.get('/status', async function (req, res) {
ethPrices, ethPrices,
relayerServiceFee, relayerServiceFee,
nonce, nonce,
version version,
latestBlock
}) })
}) })