checkVaildBlock.js 에 이어서
function isValidChain(newBlocks){
if(JSON.stringify(newBlocks[0]) !== JSON.stringify(Blocks[0])){
return false;
}
var tempBlocks = [newBlocks[0]];
for(var i = 1; i< newBlocks.length; i++){
if(isValidNewBlock(newBlock[i], tempBlocks[i-1])){
tempBlocks.push(newBlocks[i]);
}
else {
return false;
}
}
return true;
}