aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-07-12 17:06:20 -0400
committerAndrew Chow <achow101-github@achow101.com>2022-06-27 16:47:48 -0400
commitd557eff2add151781537978e27d6f1aff1b83ef7 (patch)
tree523280e1d651523bf80ccf02146c042b9ead7596
parentd43923c38155fdadad3837d79c19a84c9d2d7f50 (diff)
downloadbitcoin-d557eff2add151781537978e27d6f1aff1b83ef7.tar.xz
Add serialization methods to XOnlyPubKey
It is useful to have serialzation methods for XOnlyPubKey. These will serialize the internal uint256, so it is not prefixed with the length as CPubKey does.
-rw-r--r--src/pubkey.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pubkey.h b/src/pubkey.h
index dfe06f834c..463efe1b00 100644
--- a/src/pubkey.h
+++ b/src/pubkey.h
@@ -286,6 +286,9 @@ public:
bool operator==(const XOnlyPubKey& other) const { return m_keydata == other.m_keydata; }
bool operator!=(const XOnlyPubKey& other) const { return m_keydata != other.m_keydata; }
bool operator<(const XOnlyPubKey& other) const { return m_keydata < other.m_keydata; }
+
+ //! Implement serialization without length prefixes since it is a fixed length
+ SERIALIZE_METHODS(XOnlyPubKey, obj) { READWRITE(obj.m_keydata); }
};
struct CExtPubKey {