Don't pass nHashType down to script.h/.cpp#4555
Conversation
|
Untested ACK. I've always wondered what the nHashType flag was for, really... |
|
Removed nHashType from EvalScript and CheckSig as well. Maybe I can unify some of the commits (all of them?) |
src/test/script_tests.cpp
Outdated
There was a problem hiding this comment.
This was the only place where something different from 0 (SIGHASH_NONE = 2) was passed down, but the tests are running just fine without passing it.
|
@sipa nHashType is useful to determine what hash types are being used in scriptSigs; I'm actually working on a patch to eliminate a SIGHASH_ANYONECANPAY-related DoS attack that needs it. That said, it might be more useful to have a mechanism the hash types used are added to a list, or for that matter, a generic callback is called to let the callee apply whatever logic they need. |
|
@petertodd I'm not convinced that's currently a use case worth keeping the nHashType parameter for, especially as the implementation is not certain. |
|
@sipa Yeah, a sighash callback probably makes more sense and keeps more code out of the consensus critical section. So untested ACK. |
|
Tested ACK. Did a testnet sync from scratch with it (which likely has more cases of odd hashtypes than mainnet). |
|
|
|
Rebased on top of #4754 |
|
Rebased on top of #4755 |
|
Tested ACK |
|
Needs rebase (but a rebased version is in #4890). |
|
Rebased |
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4555_6dcfda2dc48bee2148acd571dce7d3f09608d7a2/ for binaries and test log. |
-Remove unused function main:VerifySignature (Class CScriptCheck is being used directly instead.)
-Remove CScriptCheck::nHashType (was always 0)