stop for loop after genesis block
prevHash == undefined for the genesis block
This commit is contained in:
parent
e581ef7fe3
commit
e8986e5fdc
@ -567,7 +567,7 @@ class Routes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let nextHash = startFromHash;
|
let nextHash = startFromHash;
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10 && nextHash; i++) {
|
||||||
const localBlock = blocks.getBlocks().find((b) => b.id === nextHash);
|
const localBlock = blocks.getBlocks().find((b) => b.id === nextHash);
|
||||||
if (localBlock) {
|
if (localBlock) {
|
||||||
returnBlocks.push(localBlock);
|
returnBlocks.push(localBlock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user