Fix & reenable cpfp indexer optimized path

This commit is contained in:
Mononaut
2022-12-07 18:58:03 -06:00
parent 07987ff4b6
commit fb137e6247
2 changed files with 9 additions and 5 deletions

View File

@@ -44,7 +44,9 @@ class TransactionRepository {
const [rows]: any = await DB.query(query, [txid]);
if (rows.length) {
rows[0].txs = JSON.parse(rows[0].txs) as Ancestor[];
return this.convertCpfp(rows[0]);
if (rows[0]?.txs?.length) {
return this.convertCpfp(rows[0]);
}
}
} catch (e) {
logger.err('Cannot get transaction cpfp info from db. Reason: ' + (e instanceof Error ? e.message : e));