diff --git a/lib/utils.js b/lib/utils.js index 5b446c3..0140226 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -81,9 +81,13 @@ exports.validateAllocation = function(conf, callback) { const self = this; if (!self._isValidStorageAllocationFormat(conf.storageAllocation)) { - return callback( - new Error('Invalid storage size specified: '+ conf.storageAllocation) - ); + if (isNaN(conf.storageAllocation)) { + return callback( + new Error('Invalid storage size specified: '+ conf.storageAllocation) + ); + } + + conf.storageAllocation = conf.storageAllocation.toString() + 'B'; } self.getFreeSpace(conf.storagePath, function(err, free) { @@ -95,7 +99,7 @@ exports.validateAllocation = function(conf, callback) { } if (allocatedSpace > free + usedSpaceBytes) { - return callback(new Error('Invalid storage size: '+ + return callback(new Error('Invalid storage size: '+ -(free + usedSpaceBytes - allocatedSpace) +' bytes missing')); } diff --git a/package.json b/package.json index 3180513..f7eb855 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "storjshare-daemon", - "version": "3.5.3", + "version": "3.5.4", "description": "daemon + process manager for sharing space on the storj network", "main": "index.js", "bin": {