aboutsummaryrefslogtreecommitdiff
path: root/src/pubkey.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey.h')
-rw-r--r--src/pubkey.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pubkey.h b/src/pubkey.h
index 274779f9a4..4b34fd829b 100644
--- a/src/pubkey.h
+++ b/src/pubkey.h
@@ -191,6 +191,12 @@ public:
return size() > 0;
}
+ /** Check if a public key is a syntactically valid compressed or uncompressed key. */
+ bool IsValidNonHybrid() const noexcept
+ {
+ return size() > 0 && (vch[0] == 0x02 || vch[0] == 0x03 || vch[0] == 0x04);
+ }
+
//! fully validate whether this is a valid public key (more expensive than IsValid())
bool IsFullyValid() const;