Browse Source

be more precise on error message

activeAddress
Ivan Socolsky 10 years ago
parent
commit
21ac7b0243
  1. 2
      lib/server.js
  2. 2
      test/integration/server.js

2
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'));

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

Loading…
Cancel
Save