Changeset View
Changeset View
Standalone View
Standalone View
src/test/transaction_tests.cpp
Show First 20 Lines • Show All 356 Lines • ▼ Show 20 Lines | |||||
static CScript PushAll(const std::vector<valtype> &values) { | static CScript PushAll(const std::vector<valtype> &values) { | ||||
CScript result; | CScript result; | ||||
for (const valtype &v : values) { | for (const valtype &v : values) { | ||||
if (v.size() == 0) { | if (v.size() == 0) { | ||||
result << OP_0; | result << OP_0; | ||||
} else if (v.size() == 1 && v[0] >= 1 && v[0] <= 16) { | } else if (v.size() == 1 && v[0] >= 1 && v[0] <= 16) { | ||||
result << CScript::EncodeOP_N(v[0]); | result << CScript::EncodeOP_N(v[0]); | ||||
} else if (v.size() == 1 && v[0] == 0x81) { | |||||
result << OP_1NEGATE; | |||||
} else { | } else { | ||||
result << v; | result << v; | ||||
} | } | ||||
} | } | ||||
return result; | return result; | ||||
} | } | ||||
static void ReplaceRedeemScript(CScript &script, const CScript &redeemScript) { | static void ReplaceRedeemScript(CScript &script, const CScript &redeemScript) { | ||||
▲ Show 20 Lines • Show All 567 Lines • Show Last 20 Lines |