Transaction: re-adds getHash as a pure hash

This commit is contained in:
Daniel Cousens 2014-06-16 18:52:06 +10:00
parent 6c9f95c253
commit 0b17c2bc3d
2 changed files with 17 additions and 4 deletions

View file

@ -193,8 +193,12 @@ Transaction.prototype.hashForSignature = function(prevOutScript, inIndex, hashTy
return crypto.hash256(buffer)
}
Transaction.prototype.getHash = function () {
return crypto.hash256(this.toBuffer())
}
Transaction.prototype.getId = function () {
var buffer = crypto.hash256(this.toBuffer())
var buffer = this.getHash()
// Big-endian is used for TxHash
Array.prototype.reverse.call(buffer)