Browse Source

remove processOutput and processExistingOutput

instead of processOutput, use processTx instead
processExistingOutput is time based which is not reliable
hk-custom-address
Wei Lu 11 years ago
parent
commit
5d79b094d4
  1. 22
      src/wallet.js

22
src/wallet.js

@ -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])

Loading…
Cancel
Save