Skip to content

Commit

Permalink
fix(protocol): fix revert reading blockhash (TKO-19) (#15570)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Jan 26, 2024
1 parent 27ce911 commit 465f7f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L2/TaikoL2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ contract TaikoL2 is CrossChainOwned, TaikoL2Signer, ICrossChainSync {
/// block id is greater than or equal to the current block number.
function getBlockHash(uint64 blockId) public view returns (bytes32) {
if (blockId >= block.number) return 0;
if (blockId >= block.number - 256) return blockhash(blockId);
if (blockId + 256 >= block.number) return blockhash(blockId);
return l2Hashes[blockId];
}

Expand Down

0 comments on commit 465f7f4

Please sign in to comment.