Gas requirement of function high on azure private ethereum network

2018-05-15 11:56:04

I deployed a smart contract how manage an ICO on azure private ethereum network.

Some of the functions in the contract have a high gas requirements and can not be executed.

for example:

function sell(uint256 amount) public

{

require(address(this).balance >= amount * sellPrice);

_transfer(msg.sender, this, amount);

msg.sender.transfer(amount * sellPrice);

}

I get remix warning - "Gas requirement of function sell(uint256) high: infinite. If the gas requirement of a function is higher than the block gas limit, it cannot be executed. Please avoid loops in your functions or actions that modify large areas of storage (this includes clearing or copying arrays in storage)"

I know that Geth have the option to adjust the max gas limit with "--targetgaslimit" through ssh but it work for me.

I edited the geth.cfg and adjusted GASLIMIT="0xffffff" but the function still can't be executed.

Do i have a way to reduce the functions gas consumption or sh