We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a849fe0 + a5bec61 commit 1090abdCopy full SHA for 1090abd
src/api/controllers/db-controller.ts
@@ -467,15 +467,14 @@ export async function getRosettaBlockFromDataStore(
467
blockHeight?: number
468
): Promise<FoundOrNot<RosettaBlock>> {
469
return await db.sqlTransaction(async sql => {
470
- let query;
+ let blockQuery: FoundOrNot<DbBlock>;
471
if (blockHash) {
472
- query = db.getBlock({ hash: blockHash });
+ blockQuery = await db.getBlock({ hash: blockHash });
473
} else if (blockHeight && blockHeight > 0) {
474
- query = db.getBlock({ height: blockHeight });
+ blockQuery = await db.getBlock({ height: blockHeight });
475
} else {
476
- query = db.getCurrentBlock();
+ blockQuery = await db.getCurrentBlock();
477
}
478
- const blockQuery = await query;
479
480
if (!blockQuery.found) {
481
return { found: false };
0 commit comments