aboutsummaryrefslogtreecommitdiff
path: root/src/pubkey.h
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/pubkey.h
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/pubkey.h')
-rw-r--r--src/pubkey.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pubkey.h b/src/pubkey.h
index 59bf56395c..9c6c6b085e 100644
--- a/src/pubkey.h
+++ b/src/pubkey.h
@@ -70,6 +70,11 @@ private:
}
public:
+
+ bool static ValidSize(const std::vector<unsigned char> &vch) {
+ return vch.size() > 0 && GetLen(vch[0]) == vch.size();
+ }
+
//! Construct an invalid public key.
CPubKey()
{