Bitcoin Core  0.19.99
P2P Digital Currency
keyorigin.h
Go to the documentation of this file.
1 // Copyright (c) 2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_SCRIPT_KEYORIGIN_H
6 #define BITCOIN_SCRIPT_KEYORIGIN_H
7 
8 #include <serialize.h>
9 #include <vector>
10 
12 {
13  unsigned char fingerprint[4];
14  std::vector<uint32_t> path;
15 
16  friend bool operator==(const KeyOriginInfo& a, const KeyOriginInfo& b)
17  {
18  return std::equal(std::begin(a.fingerprint), std::end(a.fingerprint), std::begin(b.fingerprint)) && a.path == b.path;
19  }
20 
22  template <typename Stream, typename Operation>
23  inline void SerializationOp(Stream& s, Operation ser_action)
24  {
25  READWRITE(fingerprint);
26  READWRITE(path);
27  }
28 
29  void clear()
30  {
31  memset(fingerprint, 0, 4);
32  path.clear();
33  }
34 };
35 
36 #endif // BITCOIN_SCRIPT_KEYORIGIN_H
unsigned char fingerprint[4]
First 32 bits of the Hash160 of the public key at the root of the path.
Definition: keyorigin.h:13
void clear()
Definition: keyorigin.h:29
friend bool operator==(const KeyOriginInfo &a, const KeyOriginInfo &b)
Definition: keyorigin.h:16
#define READWRITE(...)
Definition: serialize.h:191
std::vector< uint32_t > path
Definition: keyorigin.h:14
void SerializationOp(Stream &s, Operation ser_action)
Definition: keyorigin.h:23