remove processOutput and processExistingOutput

instead of processOutput, use processTx instead
processExistingOutput is time based which is not reliable
This commit is contained in:
Wei Lu 2014-03-23 20:16:27 +08:00
parent eb9e98aa7b
commit 5d79b094d4

View file

@ -164,28 +164,6 @@ var Wallet = function (seed, options) {
})
}
// Processes an output from an external source of the form
// { output: txhash:index, value: integer, address: address }
// Excellent compatibility with SX and pybitcointools
this.processOutput = function(o) {
if (!this.outputs[o.output] || this.outputs[o.output].pending)
this.outputs[o.output] = o;
}
this.processExistingOutputs = function() {
var t = new Date().getTime() / 1000
for (var o in this.outputs) {
if (o.pending && t > o.timestamp + 1200)
delete this.outputs[o]
if (o.spendpending && t > o.timestamp + 1200) {
o.spendpending = false
o.spend = false
delete o.timestamp
}
}
}
var peoInterval = setInterval(this.processExistingOutputs, 10000)
this.getUtxoToPay = function(value) {
var h = []
for (var out in this.outputs) h.push(this.outputs[out])