This repository was archived by the owner on Dec 13, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -196,25 +196,29 @@ async function findMissingBlocks(hashList: string[]): Promise<UnsyncedBlock[]> {
196196 ) ;
197197
198198 for await ( const rowResult of result ) {
199- const matchingRow = hashListObject [ rowResult . height . toString ( ) ] ;
199+ const matchingRow = hashListObject [ rowResult . height . toNumber ( ) ] ;
200200
201201 if (
202202 matchingRow &&
203- R . equals ( matchingRow [ "hash" ] , rowResult . indep_hash ) &&
204- R . equals ( matchingRow [ "height" ] , rowResult . height )
203+ R . equals ( matchingRow [ "hash" ] , rowResult . indep_hash . toString ( ) ) &&
204+ R . equals ( matchingRow [ "height" ] , rowResult . height . toNumber ( ) )
205205 ) {
206- delete hashListObject [ rowResult . height ] ;
206+ delete hashListObject [ rowResult . height . toNumber ( ) ] ;
207207 } else {
208208 if ( ! matchingRow ) {
209209 log . info ( `Found missing block: ${ rowResult . height } ` ) ;
210- } else if ( ! R . equals ( matchingRow [ "height" ] , rowResult . height ) ) {
210+ } else if ( ! R . equals ( matchingRow [ "height" ] , rowResult . height . toNumber ( ) ) ) {
211211 log . info (
212212 `Found mismatching block at: ${ rowResult . height } because ${ matchingRow [ "height" ] } != ${ rowResult . height } `
213213 ) ;
214- } else if ( ! R . equals ( matchingRow [ "hash" ] , rowResult . indep_hash ) ) {
214+ } else if ( ! R . equals ( matchingRow [ "hash" ] , rowResult . indep_hash . toString ( ) ) ) {
215215 log . info (
216216 `Found mismatching block at: ${ rowResult . height } because ${ matchingRow [ "hash" ] } != ${ rowResult . indep_hash } `
217217 ) ;
218+ } else {
219+ log . info (
220+ `Found mismatching block at: ${ rowResult . height } for unknown reason`
221+ ) ;
218222 }
219223 }
220224 }
You can’t perform that action at this time.
0 commit comments