set the default limit if the contract deploy option is false

This commit is contained in:
Iuri Matias 2016-10-20 23:22:31 -04:00
parent bf509e8b27
commit 727e2d0923
1 changed files with 6 additions and 1 deletions

View File

@ -44,7 +44,12 @@ ContractsManager.prototype.build = function() {
contract.abiDefinition = compiledContract.abiDefinition;
if (this.contractsConfig.gas === 'auto') {
var maxGas = Math.max(contract.gasEstimates.creation[0], contract.gasEstimates.creation[1], 500000);
var maxGas;
if (contract.deploy) {
maxGas = Math.max(contract.gasEstimates.creation[0], contract.gasEstimates.creation[1], 500000);
} else {
maxGas = 500000;
}
var adjustedGas = Math.round(maxGas * 1.01);
contract.gas = adjustedGas;
} else {