fix border condition
This commit is contained in:
parent
08f37a97b6
commit
c2d0d59955
|
@ -945,8 +945,13 @@ WalletService.prototype._totalizeUtxos = function(utxos) {
|
||||||
WalletService.prototype._computeBytesToSendMax = function(utxos, cb) {
|
WalletService.prototype._computeBytesToSendMax = function(utxos, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
var size = {
|
||||||
|
all: 0,
|
||||||
|
confirmed: 0
|
||||||
|
};
|
||||||
|
|
||||||
var unlockedUtxos = _.reject(utxos, 'locked');
|
var unlockedUtxos = _.reject(utxos, 'locked');
|
||||||
if (_.isEmpty(unlockedUtxos)) return cb(null, 0);
|
if (_.isEmpty(unlockedUtxos)) return cb(null, size);
|
||||||
|
|
||||||
self.getWallet({}, function(err, wallet) {
|
self.getWallet({}, function(err, wallet) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
@ -957,7 +962,6 @@ WalletService.prototype._computeBytesToSendMax = function(utxos, cb) {
|
||||||
walletN: wallet.n,
|
walletN: wallet.n,
|
||||||
});
|
});
|
||||||
|
|
||||||
var size = {};
|
|
||||||
|
|
||||||
txp.inputs = unlockedUtxos;
|
txp.inputs = unlockedUtxos;
|
||||||
size.all = txp.getEstimatedSize();
|
size.all = txp.getEstimatedSize();
|
||||||
|
|
Loading…
Reference in New Issue