Transaction: use hash Buffer instead of hex string
This commit is contained in:
parent
2f56e63491
commit
5551c38812
5 changed files with 44 additions and 33 deletions
src
|
@ -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]
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue