Giveth / vaultcontroller

Vault Architecture
GNU General Public License v3.0
0 stars 3 forks source link

Set checkXXXX as constant #15

Open adria0 opened 7 years ago

adria0 commented 7 years ago

A functions prefixed check modifies internal counters, consider to make the function constant and move counter inc to the non-const caller functions.

function checkMainTransfer(address _recipient, uint _amount) internal returns (bool) {
    ...
    accTxsInDay ++;
    ...
}
function checkSpenderTransfer(Spender storage spender, address _recipient, uint _amount) internal returns (bool) {
    ...
    spender.accTxsInDay ++; 
    ...
}
jbaylina commented 7 years ago

May be we need to find a better name for this functions, but the check has a daily state, so I don't see a better place to move this..