Browse Source

Reversed txhash

hk-custom-address
vub 12 years ago
parent
commit
b8023389fd
  1. 2
      bitcoinjs-min.js
  2. 4
      src/transaction.js

2
bitcoinjs-min.js

File diff suppressed because one or more lines are too long

4
src/transaction.js

@ -217,11 +217,13 @@ function (connectedScript, inIndex, hashType)
/** /**
* Calculate and return the transaction's hash. * Calculate and return the transaction's hash.
* Reverses hash since blockchain.info, blockexplorer.com and others
* use little-endian hashes for some stupid reason
*/ */
Transaction.prototype.getHash = function () Transaction.prototype.getHash = function ()
{ {
var buffer = this.serialize(); var buffer = this.serialize();
return Crypto.SHA256(Crypto.SHA256(buffer, {asBytes: true}), {asBytes: true}); return Crypto.SHA256(Crypto.SHA256(buffer, {asBytes: true}), {asBytes: true}).reverse();
}; };
/** /**

Loading…
Cancel
Save