Check tx proposal minimum amount

This commit is contained in:
Ivan Socolsky 2014-08-21 16:02:02 -03:00
commit ce910fe52f
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) {