aboutsummaryrefslogtreecommitdiff
path: root/src/keystore.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/keystore.cpp
parent4a62ddd01873d18dbca96c81d756be1020249b45 (diff)
downloadbitcoin-f8c249ab918b0b4d326b8c441816c64d046455bf.tar.xz
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/keystore.cpp')
-rw-r--r--src/keystore.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/keystore.cpp b/src/keystore.cpp
index fab1b81c9a..e3f2a17009 100644
--- a/src/keystore.cpp
+++ b/src/keystore.cpp
@@ -131,7 +131,7 @@ static bool ExtractPubKey(const CScript &dest, CPubKey& pubKeyOut)
CScript::const_iterator pc = dest.begin();
opcodetype opcode;
std::vector<unsigned char> vch;
- if (!dest.GetOp(pc, opcode, vch) || vch.size() < 33 || vch.size() > 65)
+ if (!dest.GetOp(pc, opcode, vch) || !CPubKey::ValidSize(vch))
return false;
pubKeyOut = CPubKey(vch);
if (!pubKeyOut.IsFullyValid())