|
@ -769,17 +769,16 @@ WalletService.prototype._selectTxInputs = function(txp, cb) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
|
function sortUtxos(utxos) { |
|
|
function sortUtxos(utxos) { |
|
|
var confirmed = []; |
|
|
|
|
|
var unconfirmed = []; |
|
|
|
|
|
|
|
|
|
|
|
_.each(utxos, function(utxo) { |
|
|
_.each(utxos, function(utxo) { |
|
|
if (utxo.confirmations > 0) { |
|
|
if (utxo.confirmations == 0) { |
|
|
confirmed.push(utxo); |
|
|
utxo.confirmationLevel = 0; |
|
|
|
|
|
} else if (utxo.confirmations < 6) { |
|
|
|
|
|
utxo.confirmationLevel = -1; |
|
|
} else { |
|
|
} else { |
|
|
unconfirmed.push(utxo); |
|
|
utxo.confirmationLevel = -2; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
return confirmed.concat(unconfirmed); |
|
|
return _.sortBy(utxos, 'confirmationLevel'); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
self._getUtxos(function(err, utxos) { |
|
|
self._getUtxos(function(err, utxos) { |
|
|