File tree Expand file tree Collapse file tree 3 files changed +39
-25
lines changed Expand file tree Collapse file tree 3 files changed +39
-25
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ BITCOIN_CORE_H = \
181
181
rpc/util.h \
182
182
scheduler.h \
183
183
script/descriptor.h \
184
+ script/keyorigin.h \
184
185
script/sigcache.h \
185
186
script/sign.h \
186
187
script/standard.h \
Original file line number Diff line number Diff line change
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 < streams.h>
10
+ #include < vector>
11
+
12
+ struct KeyOriginInfo
13
+ {
14
+ unsigned char fingerprint[4 ]; // !< First 32 bits of the Hash160 of the public key at the root of the path
15
+ std::vector<uint32_t > path;
16
+
17
+ friend bool operator ==(const KeyOriginInfo& a, const KeyOriginInfo& b)
18
+ {
19
+ return std::equal (std::begin (a.fingerprint ), std::end (a.fingerprint ), std::begin (b.fingerprint )) && a.path == b.path ;
20
+ }
21
+
22
+ ADD_SERIALIZE_METHODS;
23
+ template <typename Stream, typename Operation>
24
+ inline void SerializationOp (Stream& s, Operation ser_action)
25
+ {
26
+ READWRITE (fingerprint);
27
+ READWRITE (path);
28
+ }
29
+
30
+ void clear ()
31
+ {
32
+ memset (fingerprint, 0 , 4 );
33
+ path.clear ();
34
+ }
35
+ };
36
+
37
+ #endif // BITCOIN_SCRIPT_KEYORIGIN_H
Original file line number Diff line number Diff line change 10
10
#include < hash.h>
11
11
#include < pubkey.h>
12
12
#include < script/interpreter.h>
13
+ #include < script/keyorigin.h>
13
14
#include < streams.h>
14
15
15
16
class CKey ;
@@ -20,31 +21,6 @@ class CTransaction;
20
21
21
22
struct CMutableTransaction ;
22
23
23
- struct KeyOriginInfo
24
- {
25
- unsigned char fingerprint[4 ]; // !< First 32 bits of the Hash160 of the public key at the root of the path
26
- std::vector<uint32_t > path;
27
-
28
- friend bool operator ==(const KeyOriginInfo& a, const KeyOriginInfo& b)
29
- {
30
- return std::equal (std::begin (a.fingerprint ), std::end (a.fingerprint ), std::begin (b.fingerprint )) && a.path == b.path ;
31
- }
32
-
33
- ADD_SERIALIZE_METHODS;
34
- template <typename Stream, typename Operation>
35
- inline void SerializationOp (Stream& s, Operation ser_action)
36
- {
37
- READWRITE (fingerprint);
38
- READWRITE (path);
39
- }
40
-
41
- void clear ()
42
- {
43
- memset (fingerprint, 0 , 4 );
44
- path.clear ();
45
- }
46
- };
47
-
48
24
/* * An interface to be implemented by keystores that support signing. */
49
25
class SigningProvider
50
26
{
You can’t perform that action at this time.
0 commit comments