Hello I'm looking here: https://github.com/bitcoin/bitcoin/blob/master/src/script.h#L482
This is used to remove OP_CODE_SEPARATOR codes and signatures. So from what I can tell the OP_CODE_SERPARATOR codes are just removed if they match the next operator in the loop. For signatures, how do they match? Do the signatures have to match the entire push operation? It seems like it may also match signatures if they come after each other in a push operation like:
OP_PUSHDATA1 <num_of_bytes_to_push_for_3_sigs> <sig_bytes> <sig_bytes> <sig_bytes>
So it would match if the signature repeats like that? Or would it only match the first one? Also it seems to me that data in front of the signature would cause the signature not to be removed. Any data after the signature is ignored. Is this right?
Signature not removed?:
OP_PUSHDATA1 <num_of_bytes_to_push> <arbitrary_data> <sig_bytes>
Signature removed but not arbitrary data?:
OP_PUSHDATA1 <num_of_bytes_to_push> <sig_bytes> <arbitrary_data>
Obviously this is important to make OP_CHECKSIG etc. to work.