MCPcopy Create free account
hub / github.com/ElementsProject/elements / pushspk

Function pushspk

src/script/interpreter.cpp:124–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124static inline void pushspk(std::vector<valtype>& stack, const CScript& scriptPubKey, const uint256& scriptPubKey_sha)
125{
126 int witnessversion;
127 valtype witnessprogram;
128 if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {
129 stack.push_back(std::move(witnessprogram));
130 stack.push_back(CScriptNum(witnessversion).getvch());
131 } else {
132 stack.emplace_back(scriptPubKey_sha.begin(), scriptPubKey_sha.end());
133 stack.push_back(CScriptNum(-1).getvch());
134 }
135}
136
137/** Compute the outpoint flag(u8) for a given txin **/
138template <class T>

Callers 1

EvalScriptFunction · 0.85

Calls 7

IsWitnessProgramMethod · 0.80
emplace_backMethod · 0.80
CScriptNumClass · 0.70
push_backMethod · 0.45
getvchMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected