diff --git a/lib/transaction/transaction.js b/lib/transaction/transaction.js index 150a91b49..231af0ef4 100644 --- a/lib/transaction/transaction.js +++ b/lib/transaction/transaction.js @@ -1494,7 +1494,7 @@ Transaction.prototype.getOutPointBuffer = function getOutPointBuffer( ); } - var binaryTransactionHash = Buffer.from(this.hash, 'hex'); + var binaryTransactionHash = this._getHash(); var indexBuffer = Buffer.alloc(4); indexBuffer.writeUInt32LE(outputIndex, 0); diff --git a/test/transaction/transaction.js b/test/transaction/transaction.js index 7c8e0b366..57d8f5072 100644 --- a/test/transaction/transaction.js +++ b/test/transaction/transaction.js @@ -1591,7 +1591,7 @@ describe('Transaction', function () { var outPointBuffer = transaction.getOutPointBuffer(0); - expect(outPointBuffer.toString('hex')).to.be.equal(txHash + indexHex); + expect(outPointBuffer.toString('hex')).to.be.equal(transaction._getHash().toString('hex') + indexHex); expect(outPointBuffer.length).to.be.equal(36); });