diff options
author | Andrew Chow <achow101-github@achow101.com> | 2021-07-12 17:06:20 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2022-06-27 16:47:48 -0400 |
commit | d557eff2add151781537978e27d6f1aff1b83ef7 (patch) | |
tree | 523280e1d651523bf80ccf02146c042b9ead7596 /src/pubkey.h | |
parent | d43923c38155fdadad3837d79c19a84c9d2d7f50 (diff) |
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.
Diffstat (limited to 'src/pubkey.h')
-rw-r--r-- | src/pubkey.h | 3 |
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 { |