You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created 2 nodes,
node1 has 41 blocks created using mineBlock API
node2 has only genesis block
when node 2 is connected to peer node1, it gives following error and fails to replace the blockchain
blockchain possibly behind. We got: 0 Peer got: 41
Received blockchain is longer than current blockchain
Received blockchain invalid
The error is likely to be because of the first condition in isValidChain when called from replacechain.
var isValidChain = (blockchainToValidate) => {
if (JSON.stringify(blockchainToValidate[0]) !== JSON.stringify(getGenesisBlock())) {
return false;
Performing a JSON.stringify on an object will not always give the same value as objects are unordered.
The text was updated successfully, but these errors were encountered:
@gentleKun , This issue is due to stringifying the unordered dictionary. May not be reproducible every time. It is always safer to compare the hash value instead which proves the integrity.
Created 2 nodes,
node1 has 41 blocks created using mineBlock API
node2 has only genesis block
when node 2 is connected to peer node1, it gives following error and fails to replace the blockchain
blockchain possibly behind. We got: 0 Peer got: 41
Received blockchain is longer than current blockchain
Received blockchain invalid
The error is likely to be because of the first condition in isValidChain when called from replacechain.
Performing a JSON.stringify on an object will not always give the same value as objects are unordered.
The text was updated successfully, but these errors were encountered: