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

Commit

Permalink
fix type comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
John Doe committed May 18, 2022
1 parent c3090ba commit ffa7535
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/database/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,18 @@ async function findMissingBlocks(hashList: string[]): Promise<UnsyncedBlock[]> {

if (
matchingRow &&
R.equals(matchingRow["hash"], rowResult.indep_hash) &&
R.equals(matchingRow["height"], rowResult.height)
R.equals(matchingRow["hash"], rowResult.indep_hash.toString()) &&
R.equals(matchingRow["height"], rowResult.height.toString())
) {
delete hashListObject[rowResult.height];
delete hashListObject[rowResult.height.toString()];
} else {
if (!matchingRow) {
log.info(`Found missing block: ${rowResult.height}`);
} else if (!R.equals(matchingRow["height"], rowResult.height)) {
log.info(`Found missing block: ${rowResult.height.toString()}`);
} else if (!R.equals(matchingRow["height"].toString(), rowResult.height.toString())) {
log.info(
`Found mismatching block at: ${rowResult.height} because ${matchingRow["height"]} != ${rowResult.height}`
);
} else if (!R.equals(matchingRow["hash"], rowResult.indep_hash)) {
} else if (!R.equals(matchingRow["hash"], rowResult.indep_hash.toString())) {
log.info(
`Found mismatching block at: ${rowResult.height} because ${matchingRow["hash"]} != ${rowResult.indep_hash}`
);
Expand Down

0 comments on commit ffa7535

Please sign in to comment.