From f8c249ab918b0b4d326b8c441816c64d046455bf Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Fri, 16 Feb 2018 20:28:03 +0000 Subject: 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. --- src/pubkey.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/pubkey.h') 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 &vch) { + return vch.size() > 0 && GetLen(vch[0]) == vch.size(); + } + //! Construct an invalid public key. CPubKey() { -- cgit v1.2.3