Stats: lastLedgerTx » lastServedTxLedger

This commit is contained in:
Wietse Wind
2023-10-07 02:02:04 +02:00
parent 0e29c8e8b8
commit 6d1ffddf8d

View File

@@ -12,7 +12,7 @@ import { lastLedger } from '../lib/onLedger.mjs'
import { txCount } from '../lib/onTransaction.mjs'
const startDate = new Date()
let lastLedgerTx
let lastServedTxLedger
let wss // WebSocket Server
@@ -60,7 +60,7 @@ if (!wss) {
},
stats: {
lastLedger: lastLedger ?? null,
lastLedgerTx: lastLedgerTx ?? null,
lastServedTxLedger: lastServedTxLedger ?? null,
txCount: txCount ?? null,
},
})
@@ -76,7 +76,7 @@ if (!wss) {
res.json({
uptime: new Date() - startDate,
lastLedger: lastLedger ?? null,
lastLedgerTx: lastLedgerTx ?? null,
lastServedTxLedger: lastServedTxLedger ?? null,
txCount: txCount ?? null,
})
})
@@ -141,7 +141,7 @@ const emit = _data => {
data.xpop.blob = undefined
}
lastLedgerTx = data.origin.ledgerIndex
lastServedTxLedger = data.origin.ledgerIndex
if (account === '' || data.account === account) {
client.send(JSON.stringify(data), { binary: false })