Merge pull request #1161 from isocolsky/test/tx_min_amount

Check tx proposal minimum amount
This commit is contained in:
Matias Alejo Garcia 2014-08-21 16:55:16 -04:00
commit a749c5d08e
5 changed files with 24 additions and 3 deletions

View file

@ -8,6 +8,7 @@ angular.module('copayApp.controllers').controller('SendController',
var satToUnit = 1 / config.unitToSatoshi;
$scope.defaultFee = bitcore.TransactionBuilder.FEE_PER_1000B_SAT * satToUnit;
$scope.unitToBtc = config.unitToSatoshi / bitcore.util.COIN;
$scope.minAmount = config.limits.minAmountSatoshi * satToUnit;
$scope.loadTxs = function() {
var opts = {

View file

@ -1534,6 +1534,7 @@ Wallet.prototype.createTxSync = function(toAddress, amountSatStr, comment, utxos
preconditions.checkArgument(new Address(toAddress).network().name === this.getNetworkName(), 'networkname mismatch');
preconditions.checkState(pkr.isComplete(), 'pubkey ring incomplete');
preconditions.checkState(priv, 'no private key');
preconditions.checkArgument(bignum(amountSatStr, 10).cmp(copayConfig.limits.minAmountSatoshi) >= 0, 'invalid amount');
if (comment) preconditions.checkArgument(comment.length <= 100);
if (!opts.remainderOut) {