aboutsummaryrefslogtreecommitdiff
path: root/src/key.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-11-01 13:59:15 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-11-01 14:20:56 +0100
commitfa93ef5a8aeae36304c792697a78af2d07fd9f41 (patch)
tree15a20252f07a2c95b9fb52be37a0369a6f5c4c80 /src/key.h
parent5574881ce329f91cc5bbc2b9585860a45fde7c3c (diff)
downloadbitcoin-fa93ef5a8aeae36304c792697a78af2d07fd9f41.tar.xz
refactor: Take Span in SetSeed
This makes calling code less verbose and less fragile. Also, by adding the CKey::data() member function, it is now possible to call HexStr() with a CKey object.
Diffstat (limited to 'src/key.h')
-rw-r--r--src/key.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/key.h b/src/key.h
index 9b94baa026..af8d2e72d8 100644
--- a/src/key.h
+++ b/src/key.h
@@ -85,6 +85,7 @@ public:
//! Simple read-only vector-like interface.
unsigned int size() const { return (fValid ? keydata.size() : 0); }
+ const unsigned char* data() const { return keydata.data(); }
const unsigned char* begin() const { return keydata.data(); }
const unsigned char* end() const { return keydata.data() + size(); }
@@ -177,7 +178,7 @@ struct CExtKey {
void Decode(const unsigned char code[BIP32_EXTKEY_SIZE]);
bool Derive(CExtKey& out, unsigned int nChild) const;
CExtPubKey Neuter() const;
- void SetSeed(const unsigned char* seed, unsigned int nSeedLen);
+ void SetSeed(Span<const uint8_t> seed);
};
/** Initialize the elliptic curve support. May not be called twice without calling ECC_Stop first. */