what is the criteria for a txout script to be accepted into a mined block? is there any criteria at all? the reason i ask is that OP_RETURN
is regularly used in txout scripts yet it is not spendable:
case OP_RETURN:
{
return set_error(serror, SCRIPT_ERR_OP_RETURN);
}
and i have also seen transactions which push elements to the stack which are more than MAX_SCRIPT_ELEMENT_SIZE bytes.
i'm guessing that a syntactically incorrect script such as:
05aa
(ie OP_PUSHDATA(5) <aa>)
would not be permitted?
could someone point me to the code which miners use to validate whether a tx will be included or discarded as invalid (due to its txout scripts). i'm guessing it lies in main.cpp, but i would like to know where exactly, thanks.
obviously anybody can mine a block that is set up any way they like, but presumably there are fixed rules for whether it is considered valid or not - so other miners will know whether to use its hash as their prev-header-hash when mining the next block?