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

OPCODES_BY_NAME missing OP_TRUE and OP_FALSE #225

Open
kanzure opened this issue Jan 19, 2020 · 5 comments
Open

OPCODES_BY_NAME missing OP_TRUE and OP_FALSE #225

kanzure opened this issue Jan 19, 2020 · 5 comments

Comments

@kanzure
Copy link
Collaborator

kanzure commented Jan 19, 2020

I noticed that OP_TRUE and OP_FALSE aren't in OPCODES_BY_NAME. I am not sure if this is intentional. If it is intentional, then a comment should be added; and if it isn't, then they probably should.

OP_INVALIDOPCODE can probably stay out.

Context: I was parsing some strings like "OP_WHATEVER OP_TRUE" to convert to CScript objects, using OPCODES_BY_NAME as the lookup table.

@SachinMeier
Copy link

OP_1 and OP_0 are equivalent to OP_TRUE and OP_FALSE. This issue should be closed I believe. See https://en.bitcoin.it/wiki/Script

@kanzure
Copy link
Collaborator Author

kanzure commented Aug 11, 2020

Still useful for parsing scripts or converting from string to opcodes.

@SachinMeier
Copy link

Thank you. I'm writing a pull request now to add some more RPC calls. Would you recommend i add
"OP_TRUE": OP_1 and likewise for OP_FALSE? Or is there more needed.

@kanzure
Copy link
Collaborator Author

kanzure commented Aug 11, 2020

Go ahead and add those. Sure. I seem to recall looking at a list and comparing against what's in the library, and only found these stragglers. But don't take my word for it... it's a while ago and don't have a copy in front of me.

@SachinMeier
Copy link

Just opened PR #242 which fixes this issue (among other additions)

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

No branches or pull requests

2 participants