docs: remove inline endian-ness notes, no endianness
This commit is contained in:
parent
f1f83e7631
commit
05cfdf6a6a
3 changed files with 6 additions and 6 deletions
|
@ -246,7 +246,7 @@ Transaction.prototype.getHash = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
Transaction.prototype.getId = function () {
|
Transaction.prototype.getId = function () {
|
||||||
// TxHash is little-endian, we need big-endian
|
// transaction hash's are displayed in reverse order
|
||||||
return bufferutils.reverse(this.getHash()).toString('hex')
|
return bufferutils.reverse(this.getHash()).toString('hex')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,13 +169,13 @@ TransactionBuilder.fromTransaction = function (transaction, network) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOutScript) {
|
TransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOutScript) {
|
||||||
// is it a txId?
|
// is it a hex string?
|
||||||
if (typeof txHash === 'string') {
|
if (typeof txHash === 'string') {
|
||||||
// a txId is big-endian hex, we want a little-endian Buffer
|
// transaction hashs's are displayed in reverse order, un-reverse it
|
||||||
txHash = new Buffer(txHash, 'hex')
|
txHash = new Buffer(txHash, 'hex')
|
||||||
Array.prototype.reverse.call(txHash)
|
Array.prototype.reverse.call(txHash)
|
||||||
|
|
||||||
// is it a Transaction?
|
// is it a Transaction object?
|
||||||
} else if (txHash instanceof Transaction) {
|
} else if (txHash instanceof Transaction) {
|
||||||
prevOutScript = txHash.outs[vout].script
|
prevOutScript = txHash.outs[vout].script
|
||||||
txHash = txHash.getHash()
|
txHash = txHash.getHash()
|
||||||
|
|
|
@ -149,7 +149,7 @@ describe('Bitcoin-core', function () {
|
||||||
transaction.ins.forEach(function (txIn, i) {
|
transaction.ins.forEach(function (txIn, i) {
|
||||||
var input = inputs[i]
|
var input = inputs[i]
|
||||||
|
|
||||||
// reverse because test data is big-endian
|
// reverse because test data is reversed
|
||||||
var prevOutHash = bitcoin.bufferutils.reverse(new Buffer(input[0], 'hex'))
|
var prevOutHash = bitcoin.bufferutils.reverse(new Buffer(input[0], 'hex'))
|
||||||
var prevOutIndex = input[1]
|
var prevOutIndex = input[1]
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ describe('Bitcoin-core', function () {
|
||||||
var inIndex = f[2]
|
var inIndex = f[2]
|
||||||
var hashType = f[3]
|
var hashType = f[3]
|
||||||
|
|
||||||
// reverse because test data is big-endian
|
// reverse because test data is reversed
|
||||||
var expectedHash = bitcoin.bufferutils.reverse(new Buffer(f[4], 'hex'))
|
var expectedHash = bitcoin.bufferutils.reverse(new Buffer(f[4], 'hex'))
|
||||||
|
|
||||||
var hashTypes = []
|
var hashTypes = []
|
||||||
|
|
Loading…
Add table
Reference in a new issue