Add validation and tests for spendUnconfirmed = false

This commit is contained in:
Yemel Jardi 2014-06-19 10:30:53 -03:00
commit 26c829f6de
4 changed files with 47 additions and 7 deletions

View file

@ -647,7 +647,8 @@ Wallet.prototype.getUnspent = function(cb) {
for (var i in unspentList) {
var u = unspentList[i];
if (!uu[u.txid + ',' + u.vout])
var name = u.txid + ',' + u.vout;
if (!uu[name] && (self.spendUnconfirmed || u.confirmations >= 1))
safeUnspendList.push(u);
}