2
According to the wiki page, OP_IFDUP will duplicate the top of the stack "if the input is true or false". It seems to me that everything is true or false when interpreted as a boolean.
According to the source code:
case OP_IFDUP:
[...]
valtype vch = stacktop(-1);
if (CastToBool(vch))
stack.push_back(vch);
That suggests the wiki is incorrect. What would be a better way of wording it, and what is the operation for?
Thanks. I fixed the wiki accordingly. I copied the description from the OP_IF operation, since the code is the same. – Chris Moore – 2012-03-19T21:46:15.307