Browse Source

Merge pull request #144 from isocolsky/ref/insufficient_funds

Ref/insufficient funds
activeAddress
Matias Alejo Garcia 10 years ago
parent
commit
b412fe133b
  1. 1
      .gitignore
  2. 2
      lib/server.js
  3. 2
      package.json
  4. 2
      test/integration/server.js

1
.gitignore

@ -32,4 +32,3 @@ node_modules
out/
db/*
.bit

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
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",

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