diff --git a/.gitignore b/.gitignore index 2489e44..c46e8f2 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,3 @@ node_modules out/ db/* -.bit diff --git a/lib/server.js b/lib/server.js index 8987e06..056c74a 100644 --- a/lib/server.js +++ b/lib/server.js @@ -479,7 +479,7 @@ WalletService.prototype._selectTxInputs = function(txp, cb) { var txMinAmount = txp.amount + Bitcore.Transaction.FEE_PER_KB; if (balance.totalAmount < txMinAmount) - return cb(new ClientError('INSUFFICIENTFUNDS', 'Insufficient funds')); + return cb(new ClientError('INSUFFICIENTFUNDS', 'Insufficient funds' + (balance.totalAmount >= txp.amount ? ' for fee' : ''))); if ((balance.totalAmount - balance.lockedAmount) < txMinAmount) return cb(new ClientError('LOCKEDFUNDS', 'Funds are locked by pending transaction proposals')); diff --git a/package.json b/package.json index 4638121..1f51022 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "bitcore-wallet-service", "description": "A service for Mutisig HD Bitcoin Wallets", "author": "BitPay Inc", - "version": "0.0.6", + "version": "0.0.7", "keywords": [ "bitcoin", "copay", diff --git a/test/integration/server.js b/test/integration/server.js index 79bd38d..d223b41 100644 --- a/test/integration/server.js +++ b/test/integration/server.js @@ -938,7 +938,7 @@ describe('Copay server', function() { server.createTx(txOpts, function(err, tx) { should.exist(err); err.code.should.equal('INSUFFICIENTFUNDS'); - err.message.should.equal('Insufficient funds'); + err.message.should.equal('Insufficient funds for fee'); done(); }); });