Transaction: use hash Buffer instead of hex string

This commit is contained in:
Daniel Cousens 2014-06-15 00:03:17 +10:00
parent 2f56e63491
commit 5551c38812
5 changed files with 44 additions and 33 deletions

View file

@ -169,9 +169,15 @@ function Wallet(seed, network) {
}
})
tx.ins.forEach(function(txIn, i){
tx.ins.forEach(function(txIn, i) {
var op = txIn.outpoint
var output = op.hash + ':' + op.index
// copy and convert to big-endian hex
var txinHash = new Buffer(op.hash)
Array.prototype.reverse.call(txinHash)
txinHash = txinHash.toString('hex')
var output = txinHash + ':' + op.index
if(me.outputs[output]) delete me.outputs[output]
})