getUnspentOutputs excludes spent outputs

This commit is contained in:
Wei Lu 2014-03-25 10:41:03 +08:00
parent 77b5d1ee21
commit 9fc5505730
2 changed files with 10 additions and 2 deletions

View file

@ -64,7 +64,8 @@ var Wallet = function (seed, options) {
var utxo = []
for(var key in this.outputs){
utxo.push(outputToUnspentOutput(this.outputs[key]))
var output = this.outputs[key]
if(!output.spend) utxo.push(outputToUnspentOutput(output))
}
return utxo