new block handler logs

This commit is contained in:
boufni95 2026-02-19 21:45:31 +00:00
parent 6e8a181d34
commit 8ada2ac165
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View file

@ -161,6 +161,7 @@ export default class {
NewBlockHandler = async (height: number, skipMetrics?: boolean) => {
let confirmed: (PendingTx & { confs: number; })[]
let log = getLogger({})
log("NewBlockHandler called", JSON.stringify({ height, skipMetrics }))
this.storage.paymentStorage.DeleteExpiredTransactionSwaps(height)
.catch(err => log(ERROR, "failed to delete expired transaction swaps", err.message || err))
this.storage.paymentStorage.DeleteExpiredInvoiceSwaps(height)
@ -176,6 +177,7 @@ export default class {
log(ERROR, "failed to check transactions after new block", err.message || err)
return
}
log("NewBlockHandler new confirmed transactions", confirmed.length)
await Promise.all(confirmed.map(async c => {
if (c.type === 'outgoing') {
await this.storage.paymentStorage.UpdateUserTransactionPayment(c.tx.serial_id, { confs: c.confs })

View file

@ -980,7 +980,8 @@ export default class {
const pending = await this.storage.paymentStorage.GetPendingTransactions()
let lowestHeight = height
const map: Record<string, PendingTx> = {}
let log = getLogger({})
log("CheckNewlyConfirmedTxs ", pending.incoming.length, "incoming", pending.outgoing.length, "outgoing")
const checkTx = (t: PendingTx) => {
if (t.tx.broadcast_height < lowestHeight) { lowestHeight = t.tx.broadcast_height }
map[t.tx.tx_hash] = t