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;
|
||||
for (let i = 0; i < 10; i++) {
|
||||
for (let i = 0; i < 10 && nextHash; i++) {
|
||||
const localBlock = blocks.getBlocks().find((b) => b.id === nextHash);
|
||||
if (localBlock) {
|
||||
returnBlocks.push(localBlock);
|
||||
|
Loading…
x
Reference in New Issue
Block a user