Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    function withdrawTips() public {
        // The owner can only withdraw the tips
        tips = 0;
        owner.transfer(tips);
    }
I don't use Etherium, but that looks incorrect. Is the value of the variable only updated at the end of the run?


The code has now been changed (by switching to a new contract):

    function withdrawTips() public {
        // The owner can only withdraw the tips
        uint pendingTips = tips;
        tips = 0;
        owner.transfer(pendingTips);
    }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: