Browse Source

Merge pull request #579 from bitcoinjs/fix/isCoinbaseHash

Update Transaction.isCoinbaseHash
hk-custom-address
Daniel Cousens 9 years ago
parent
commit
7203b7a94d
  1. 8
      src/transaction.js

8
src/transaction.js

@ -82,9 +82,11 @@ Transaction.fromHex = function (hex) {
}
Transaction.isCoinbaseHash = function (buffer) {
return Array.prototype.every.call(buffer, function (x) {
return x === 0
})
typeforce(types.Hash256bit, buffer)
for (var i = 0; i < 32; ++i) {
if (buffer[i] !== 0) return false
}
return true
}
Transaction.prototype.isCoinbase = function () {

Loading…
Cancel
Save