| 180 | } |
| 181 | |
| 182 | static void CleanupScriptCode(CScript &scriptCode, |
| 183 | const std::vector<unsigned char> &vchSig, |
| 184 | uint32_t flags) { |
| 185 | // Drop the signature in scripts when SIGHASH_FORKID is not used. |
| 186 | uint32_t nHashType = GetHashType(vchSig); |
| 187 | if (!(flags & SCRIPT_ENABLE_SIGHASH_FORKID) || |
| 188 | !(nHashType & SIGHASH_FORKID)) { |
| 189 | scriptCode.FindAndDelete(CScript(vchSig)); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | static bool IsDefinedHashtypeSignature(const valtype &vchSig) { |
| 194 | if (vchSig.size() == 0) { |
no test coverage detected