block.timestamp vs block.hash

Cryptocurrency News and Public Mining Pools

block.timestamp vs block.hash

hey guys, I have a couple of questions regarding randomness in solidity

1 – is it better to use block.timestamp or block.hash?

2 – how is it possible that this.block.hash even exists in solidity? there should be an infinite loop right?

here is an example

if this.block.hash%4 == 1

{

send 10 eth to Bill

}

in this case, if the condition is True then the smart contract sends 10 eth to Bill;

well, there is a problem here, if the smart contract sends 10 Eth to Bill than it makes another transaction, that might change the block hash ( can someone tell me what I'm missing here ? thankss)

submitted by /u/iMnoTGudd
[link] [comments]