Author

Topic: Does core not-fail on invalid OP codes while counting SigOps? (Read 153 times)

legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Pull requests welcome. But there really aren't many cases to test. It's also fuzz tested and IIRC some functional tests too.
That's in my TODO list (already have 1 issue that turned into a PR for a tiny fix), but first I'll have to go through all tests and familiarize myself more with core's code. Another issue is core being in c++ and me not knowing anything about the language.
staff
Activity: 3458
Merit: 6793
Just writing some code
is counted as 20 SigOps. Is my interpretation correct? (Obviously OP_DIV is disabled and 0xff is not an OP at all).
Yes.

PS. SigOpCount tests of core needs a lot more cases, right now they seem to only test the elementary standard scripts only.
Pull requests welcome. But there really aren't many cases to test. It's also fuzz tested and IIRC some functional tests too.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
I've traced it all the way to this line:
https://github.com/bitcoin/bitcoin/blob/24f70290642c9c5108d3dc62dbe055f5d1bcff9d/src/script/script.cpp#L278
that is called by GetSigOpCount a bunch of lines above this which is called by GetTransactionSigOpCost from tx_verify.cpp
And to me it looks like a broken script such as
Code:
OP_2 OP_DIV 0xff OP_CheckMultiSig
is counted as 20 SigOps. Is my interpretation correct? (Obviously OP_DIV is disabled and 0xff is not an OP at all).

PS. SigOpCount tests of core needs a lot more cases, right now they seem to only test the elementary standard scripts only.
Jump to: