try catch get tx

This commit is contained in:
boufni95 2025-01-29 16:52:27 +00:00
parent aa47bbe7c2
commit 00f2caf7df

View file

@ -327,8 +327,13 @@ export default class Handler {
} }
}) })
const closed = await Promise.all(closedChannels.filter(c => c.closeType !== ChannelCloseSummary_ClosureType.FUNDING_CANCELED).map(async c => { const closed = await Promise.all(closedChannels.filter(c => c.closeType !== ChannelCloseSummary_ClosureType.FUNDING_CANCELED).map(async c => {
const tx = await this.lnd.GetTx(c.closingTxHash) try {
return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: Number(tx.timeStamp) } const tx = await this.lnd.GetTx(c.closingTxHash)
return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: Number(tx.timeStamp) }
} catch (e) {
return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: 0 }
}
})) }))
return { return {
nodes: [{ nodes: [{