Inside my contract, I want to verify a given block hash
is valid or not.
block_hash_validation(string blockhash) returns (bool){
...//check()
return true; || return false;
}
Q1: If yes, from block hash
value could I also learn its block number?
Q2: Or should I provide block number as well block_hash_validation(uint blockNumber, string blockhash)
to see that does the block number points to the correct block hash
?
block_hash_validation(uint blockNumber, string blockhash) returns (bool){
if(block.blockhash(blockNumber) == blockhash)
return true;
else
return false;
}
Thank you for your valuable time and help.