Skip to content

Conversation

@sidazhang
Copy link
Contributor

All tests pass with the modifications. I noticed a few other bugs. But I want to get this pull request reviewed first before I move further as this is my first pull request to this repo.

Conventions:

The script types are currently:
https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/script.js#L117-L133

Bitcoind uses these following names:
https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L75-L87

Bug:

https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/script.js#L123-L127

It is possible for the third item in a pubkeyhash script to be a 00 (push zero byte of data), for example in this transaction:

e.g.:
http://testnet.helloblock.io/transactions/a347b4ef02173b74deb096921d8306ff7c379c254e9febaa040024b220a348ed
One of the output scripts: 76a90088ac

The above is a nonstandard script that reads: OP_DUP OP_HASH160 0 OP_EQUALVERIFY OP_CHECKSIG, I believe this also appears in a number of places on mainnet

I believe we also need:
Array.isArray(this.chunks[2]) && this.chunks[2].length === 20

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get some test cases to cover the added types?

@sidazhang
Copy link
Contributor Author

@weilu I added tests for nulldata(OP_RETURN) as well as multisig

weilu added a commit that referenced this pull request Apr 14, 2014
Aligning type naming with bitcoind and fixed pubkeyhash bug
@weilu weilu merged commit 9e15b49 into bitcoinjs:master Apr 14, 2014
@weilu
Copy link
Contributor

weilu commented Apr 14, 2014

Thanks! @sidazhang

weilu added a commit that referenced this pull request Apr 14, 2014
weilu added a commit that referenced this pull request Apr 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants