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
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
This code basically says take the newest block we have and throw the old block away. This is incorrect. We need to approach this issue with the logic that the old blocks should be kept in every situation, as they will have the most adoption on the network and be forged by the correct delegate.
the revised code would look like this:
if (block.id < __private.lastBlock.id) {
if (block.timestamp < __private.lastBlock.timestamp) {
library.logger.info('Last block loses');
return self.deleteLastBlock(cb);
} else {
library.logger.info('Last block should not lose');
return setImmediate(cb);
}
} else {
library.logger.info('Newly received block wins');
return setImmediate(cb);
}
The text was updated successfully, but these errors were encountered:
When a node receives a block at the same height it does a simple check here: https://github.com/LiskHQ/lisk/blob/development/modules/blocks.js#L1341
This code basically says take the newest block we have and throw the old block away. This is incorrect. We need to approach this issue with the logic that the old blocks should be kept in every situation, as they will have the most adoption on the network and be forged by the correct delegate.
the revised code would look like this:
The text was updated successfully, but these errors were encountered: