From ffa753513846588700abcf43de6829ae922fc262 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 18 May 2022 05:18:09 -0400 Subject: [PATCH] fix type comparison --- src/database/sync.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/database/sync.ts b/src/database/sync.ts index 5ab4768f..81294e6c 100644 --- a/src/database/sync.ts +++ b/src/database/sync.ts @@ -200,18 +200,18 @@ async function findMissingBlocks(hashList: string[]): Promise { 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}` );