Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #31 from likecoin/fix_import_typo
Browse files Browse the repository at this point in the history
fix block importer fail insert due to typo
  • Loading branch information
hlolli authored Feb 19, 2022
2 parents fdd6f77 + a6ab720 commit e86fb5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/database/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ export const findBlockGaps = async (
);

const missingHeights: number[] = [];

for (const heightGroup of queryHeightGroups) {
for (const [index, heightGroup] of queryHeightGroups.entries()) {
const blockQ: { rows: unknown[] } = await cassandraClient.execute(
`SELECT block_height FROM ${KEYSPACE}.block_height_sorted_asc WHERE height >= ${R.head(
`SELECT block_height FROM ${KEYSPACE}.block_height_sorted_asc WHERE nth_million = ${index} AND block_height >= ${R.head(
heightGroup
)} AND height <= ${R.last(heightGroup)}`
)} AND block_height <= ${R.last(heightGroup)}`
);
for (const height of R.range(
R.head(heightGroup),
Expand Down
4 changes: 3 additions & 1 deletion src/workers/import-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function importBlock(

try {
await blockHeightToHashMapper.insert({
block_heigh: height,
block_height: height,
block_hash: newBlock.indep_hash,
});
} catch (error) {
Expand Down Expand Up @@ -94,6 +94,7 @@ export async function importBlock(

try {
await blockSortedAscMapper.insert({
block_height: height,
block_hash: newBlock.indep_hash,
nth_million: nthMillBlock,
});
Expand All @@ -103,6 +104,7 @@ export async function importBlock(

try {
await blockSortedDescMapper.insert({
block_height: height,
block_hash: newBlock.indep_hash,
nth_million: nthMillBlock,
});
Expand Down

0 comments on commit e86fb5a

Please sign in to comment.