|
|
@ -614,8 +614,8 @@ WalletService.prototype.joinWallet = function(opts, cb) { |
|
|
|
} |
|
|
|
|
|
|
|
if (_.find(wallet.copayers, { |
|
|
|
xPubKey: opts.xPubKey |
|
|
|
})) return cb(Errors.COPAYER_IN_WALLET); |
|
|
|
xPubKey: opts.xPubKey |
|
|
|
})) return cb(Errors.COPAYER_IN_WALLET); |
|
|
|
|
|
|
|
if (wallet.copayers.length == wallet.n) return cb(Errors.WALLET_FULL); |
|
|
|
|
|
|
@ -708,8 +708,8 @@ WalletService.prototype._canCreateAddress = function(ignoreMaxGap, cb) { |
|
|
|
isChange: true |
|
|
|
}), Defaults.MAX_MAIN_ADDRESS_GAP); |
|
|
|
if (latestAddresses.length < Defaults.MAX_MAIN_ADDRESS_GAP || _.any(latestAddresses, { |
|
|
|
hasActivity: true |
|
|
|
})) return cb(null, true); |
|
|
|
hasActivity: true |
|
|
|
})) return cb(null, true); |
|
|
|
|
|
|
|
var bc = self._getBlockchainExplorer(latestAddresses[0].network); |
|
|
|
var activityFound = false; |
|
|
@ -956,9 +956,14 @@ WalletService.prototype._computeBytesToSendMax = function(utxos, cb) { |
|
|
|
requiredSignatures: wallet.m, |
|
|
|
walletN: wallet.n, |
|
|
|
}); |
|
|
|
|
|
|
|
var size = {}; |
|
|
|
|
|
|
|
txp.inputs = unlockedUtxos; |
|
|
|
size.all = txp.getEstimatedSize(); |
|
|
|
|
|
|
|
var size = txp.getEstimatedSize(); |
|
|
|
txp.inputs = _.filter(unlockedUtxos, 'confirmations'); |
|
|
|
size.confirmed = txp.getEstimatedSize(); |
|
|
|
|
|
|
|
return cb(null, size); |
|
|
|
}); |
|
|
@ -992,7 +997,8 @@ WalletService.prototype._getBalanceFromAddresses = function(addresses, cb) { |
|
|
|
if (err) { |
|
|
|
log.error('Could not compute size of send max transaction', err); |
|
|
|
} |
|
|
|
balance.totalBytesToSendMax = _.isNumber(size) ? size : null; |
|
|
|
balance.totalBytesToSendMax = _.isNumber(size.all) ? size.all : null; |
|
|
|
balance.totalBytesToSendConfirmedMax = _.isNumber(size.confirmed) ? size.confirmed : null; |
|
|
|
return cb(null, balance); |
|
|
|
}); |
|
|
|
}); |
|
|
|