Skip to content

Commit 999962d

Browse files
author
MarcoFalke
committed
Add missing XOnlyPubKey::data() to get mutable data
This is needed for consistency, and also to allow std::span construction from XOnlyPubKey.
1 parent 2ac2821 commit 999962d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pubkey.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,11 @@ class XOnlyPubKey
285285
CPubKey GetEvenCorrespondingCPubKey() const;
286286

287287
const unsigned char& operator[](int pos) const { return *(m_keydata.begin() + pos); }
288-
const unsigned char* data() const { return m_keydata.begin(); }
289288
static constexpr size_t size() { return decltype(m_keydata)::size(); }
289+
const unsigned char* data() const { return m_keydata.begin(); }
290290
const unsigned char* begin() const { return m_keydata.begin(); }
291291
const unsigned char* end() const { return m_keydata.end(); }
292+
unsigned char* data() { return m_keydata.begin(); }
292293
unsigned char* begin() { return m_keydata.begin(); }
293294
unsigned char* end() { return m_keydata.end(); }
294295
bool operator==(const XOnlyPubKey& other) const { return m_keydata == other.m_keydata; }

0 commit comments

Comments
 (0)