You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
Activity
SachinMeier commentedon Aug 11, 2020
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 commentedon Aug 11, 2020
Still useful for parsing scripts or converting from string to opcodes.
SachinMeier commentedon Aug 11, 2020
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 commentedon 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 commentedon Aug 16, 2020
Just opened PR #242 which fixes this issue (among other additions)
script: add OP_TRUE and OP_FALSE aliases to OPCODES_BY_NAME