Skip to content

Commit

Permalink
fix: invalid outpoint buffer (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov authored Oct 30, 2023
1 parent 41f8545 commit 395665b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/transaction/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/transaction/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit 395665b

Please sign in to comment.