Merge pull request #785 from shocknet/get-tx-fix

try catch get tx
This commit is contained in:
Justin (shocknet) 2025-01-29 11:53:16 -05:00 committed by GitHub
commit 15b4f44bed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 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) }
try {
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 {
nodes: [{