Skip to content

Commit 3d718bb

Browse files
committed
add latest block
1 parent 1ac1b6c commit 3d718bb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ app.get('/', function (req, res) {
3737
res.send('This is <a href=https://tornado.cash>tornado.cash</a> Relayer service. Check the <a href=/status>/status</a> for settings')
3838
})
3939

40+
4041
app.get('/status', async function (req, res) {
4142
let nonce = await redisClient.get('nonce')
43+
let latestBlock = null
44+
try {
45+
latestBlock = await web3.eth.getBlockNumber()
46+
} catch(e) {
47+
console.error('Problem with RPC', e)
48+
}
4249
const { ethPrices } = fetcher
4350
res.json({
4451
relayerAddress: web3.eth.defaultAccount,
@@ -48,7 +55,8 @@ app.get('/status', async function (req, res) {
4855
ethPrices,
4956
relayerServiceFee,
5057
nonce,
51-
version
58+
version,
59+
latestBlock
5260
})
5361
})
5462

0 commit comments

Comments
 (0)