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

Function PushAll

src/test/transaction_tests.cpp:474–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474static CScript PushAll(const std::vector<valtype>& values)
475{
476 CScript result;
477 for (const valtype& v : values) {
478 if (v.size() == 0) {
479 result << OP_0;
480 } else if (v.size() == 1 && v[0] >= 1 && v[0] <= 16) {
481 result << CScript::EncodeOP_N(v[0]);
482 } else if (v.size() == 1 && v[0] == 0x81) {
483 result << OP_1NEGATE;
484 } else {
485 result << v;
486 }
487 }
488 return result;
489}
490
491static void ReplaceRedeemScript(CScript& script, const CScript& redeemScript)
492{

Callers 1

ReplaceRedeemScriptFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected