aboutsummaryrefslogtreecommitdiff
path: root/src/script/standard.cpp
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2018-02-16 20:28:03 +0000
committerBen Woosley <ben.woosley@gmail.com>2018-02-16 12:30:26 -0800
commitf8c249ab918b0b4d326b8c441816c64d046455bf (patch)
tree3547fc217d30021369b0c95e953a567fbd8df378 /src/script/standard.cpp
parent4a62ddd01873d18dbca96c81d756be1020249b45 (diff)
Assert CPubKey::ValidLength to the pubkey's header-relevent size
Previously this was an inline test where the specificity was probably judged overly specific. As a class method it makes sense to maintain consistency. And replace some magic values with their constant equivalents.
Diffstat (limited to 'src/script/standard.cpp')
-rw-r--r--src/script/standard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/standard.cpp b/src/script/standard.cpp
index cfb3c58588..0b9053d7fc 100644
--- a/src/script/standard.cpp
+++ b/src/script/standard.cpp
@@ -132,7 +132,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::v
// Template matching opcodes:
if (opcode2 == OP_PUBKEYS)
{
- while (vch1.size() >= 33 && vch1.size() <= 65)
+ while (CPubKey::ValidSize(vch1))
{
vSolutionsRet.push_back(vch1);
if (!script1.GetOp(pc1, opcode1, vch1))
@@ -146,7 +146,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::v
if (opcode2 == OP_PUBKEY)
{
- if (vch1.size() < 33 || vch1.size() > 65)
+ if (!CPubKey::ValidSize(vch1))
break;
vSolutionsRet.push_back(vch1);
}