Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed script.isPublicKeyHashIn bug with variable length signatures. #1213

Merged
merged 1 commit into from
May 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ Script.prototype.isPublicKeyHashOut = function() {
Script.prototype.isPublicKeyHashIn = function() {
return this.chunks.length === 2 &&
this.chunks[0].buf &&
this.chunks[0].buf.length >= 0x47 &&
this.chunks[0].buf.length <= 0x49 &&
PublicKey.isValid(this.chunks[1].buf);
};
Expand Down
4 changes: 4 additions & 0 deletions test/script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ describe('Script', function() {
Script('73 0x3046022100bb3c194a30e460d81d34be0a230179c043a656f67e3c5c8bf47eceae7c4042ee0221008bf54ca11b2985285be0fd7a212873d243e6e73f5fad57e8eb14c4f39728b8c601 65 0x04e365859b3c78a8b7c202412b949ebca58e147dba297be29eee53cd3e1d300a6419bc780cc9aec0dc94ed194e91c8f6433f1b781ee00eac0ead2aae1e8e0712c6 OP_CHECKSIG').isPublicKeyHashIn().should.equal(false);
});

it('should identify this known pubkey', function() {
Script('70 0x3043021f336721e4343f67c835cbfd465477db09073dc38a936f9c445d573c1c8a7fdf022064b0e3cb6892a9ecf870030e3066bc259e1f24841c9471d97f9be08b73f6530701 33 0x0370b2e1dcaa8f51cb0ead1221dd8cb31721502b3b5b7d4b374d263dfec63a4369').isPublicKeyHashIn().should.equal(true);
});

});

describe('#isPublicKeyHashOut', function() {
Expand Down