Add validation and tests for spendUnconfirmed = false

Add validation during the creation of safeUnspendList, now it honors the spendUnconfirmed and requires at least 1 confirmation. Closes #481
Question about this: would the balance show only the confirmed amount or
unconfirmed? Can we update it automatically as the transactions are mined?
 No sure insight broadcast to address on that event, i think we need to
subscribe to 'blocks'.

On Thursday, June 19, 2014, Manuel Aráoz <notifications@github.com> wrote:

> In js/models/core/Wallet.js:
>
> > @@ -616,7 +616,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))
>
> nice code
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/bitpay/copay/pull/709/files#r13968028>.
>


-- 
Matías Alejo Garcia
Skype/Twitter: @ematiu
Roads? Where we're going, we don't need roads!