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/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(); }); });