MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetSigOpCount

Method GetSigOpCount

src/script/script.cpp:149–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149unsigned int CScript::GetSigOpCount(bool fAccurate) const
150{
151 unsigned int n = 0;
152 const_iterator pc = begin();
153 opcodetype lastOpcode = OP_INVALIDOPCODE;
154 while (pc < end())
155 {
156 opcodetype opcode;
157 if (!GetOp(pc, opcode))
158 break;
159 if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY)
160 n++;
161 else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY)
162 {
163 if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16)
164 n += DecodeOP_N(lastOpcode);
165 else
166 n += MAX_PUBKEYS_PER_MULTISIG;
167 }
168 lastOpcode = opcode;
169 }
170 return n;
171}
172
173unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const
174{

Callers 5

AreInputsStandardFunction · 0.45
WitnessSigOpsFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
GetLegacySigOpCountFunction · 0.45
GetP2SHSigOpCountFunction · 0.45

Calls 3

GetOpMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.36