Changeset View
Changeset View
Standalone View
Standalone View
src/script/script.h
Show First 20 Lines • Show All 540 Lines • ▼ Show 20 Lines | static opcodetype EncodeOP_N(int n) { | ||||
assert(n >= 0 && n <= 16); | assert(n >= 0 && n <= 16); | ||||
if (n == 0) { | if (n == 0) { | ||||
return OP_0; | return OP_0; | ||||
} | } | ||||
return (opcodetype)(OP_1 + n - 1); | return (opcodetype)(OP_1 + n - 1); | ||||
} | } | ||||
/** | |||||
* Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs as 20 sigops. With | |||||
* pay-to-script-hash, that changed: CHECKMULTISIGs serialized in scriptSigs | |||||
* are counted more accurately, assuming they are of the form | |||||
* ... OP_N CHECKMULTISIG ... | |||||
*/ | |||||
uint32_t GetSigOpCount(uint32_t flags, bool fAccurate) const; | |||||
/** | |||||
* Accurately count sigOps, including sigOps in pay-to-script-hash | |||||
* transactions: | |||||
*/ | |||||
uint32_t GetSigOpCount(uint32_t flags, const CScript &scriptSig) const; | |||||
bool IsPayToScriptHash() const; | bool IsPayToScriptHash() const; | ||||
bool IsCommitment(const std::vector<uint8_t> &data) const; | bool IsCommitment(const std::vector<uint8_t> &data) const; | ||||
bool IsWitnessProgram(int &version, std::vector<uint8_t> &program) const; | bool IsWitnessProgram(int &version, std::vector<uint8_t> &program) const; | ||||
bool IsWitnessProgram() const; | bool IsWitnessProgram() const; | ||||
/** | /** | ||||
* Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it | * Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it | ||||
* consensus-critical). | * consensus-critical). | ||||
Show All 33 Lines |