I found this code at the following site:
for (uint i=0; i<investors.length; i++) {
if (investors[i].invested == min_investment) {
// Refund, and check for failure.
// This code looks benign but will lock the entire contract
// if attacked by a griefing wallet.
if (!(investors[i].address.send(investors[i].dividendAmount)))
{
throw;
}
investors[i] = newInvestor;
}
}
I understand that using a loop to send balance is dangerous because if one transaction fails then all transaction would fail. Why 'throw' is considered dangerous in this code? Just because it would revert and the owner would not get any money? How it would lock the contract? Because 'throw' consumes all the gas?
Somebody please guide me.