Bitcoin Core  0.20.99
P2P Digital Currency
ismine_tests.cpp
Go to the documentation of this file.
1 // Copyright (c) 2017-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 #include <key.h>
6 #include <node/context.h>
7 #include <script/script.h>
8 #include <script/standard.h>
9 #include <test/util/setup_common.h>
10 #include <wallet/ismine.h>
11 #include <wallet/wallet.h>
12 
13 #include <boost/test/unit_test.hpp>
14 
15 
16 BOOST_FIXTURE_TEST_SUITE(ismine_tests, BasicTestingSetup)
17 
18 BOOST_AUTO_TEST_CASE(ismine_standard)
19 {
20  CKey keys[2];
21  CPubKey pubkeys[2];
22  for (int i = 0; i < 2; i++) {
23  keys[i].MakeNewKey(true);
24  pubkeys[i] = keys[i].GetPubKey();
25  }
26 
27  CKey uncompressedKey;
28  uncompressedKey.MakeNewKey(false);
29  CPubKey uncompressedPubkey = uncompressedKey.GetPubKey();
30  NodeContext node;
31  std::unique_ptr<interfaces::Chain> chain = interfaces::MakeChain(node);
32 
33  CScript scriptPubKey;
34  isminetype result;
35 
36  // P2PK compressed
37  {
38  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
39  keystore.SetupLegacyScriptPubKeyMan();
40  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
41  scriptPubKey = GetScriptForRawPubKey(pubkeys[0]);
42 
43  // Keystore does not have key
44  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
46 
47  // Keystore has key
48  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
49  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
51  }
52 
53  // P2PK uncompressed
54  {
55  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
56  keystore.SetupLegacyScriptPubKeyMan();
57  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
58  scriptPubKey = GetScriptForRawPubKey(uncompressedPubkey);
59 
60  // Keystore does not have key
61  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
63 
64  // Keystore has key
65  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(uncompressedKey));
66  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
68  }
69 
70  // P2PKH compressed
71  {
72  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
73  keystore.SetupLegacyScriptPubKeyMan();
74  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
75  scriptPubKey = GetScriptForDestination(PKHash(pubkeys[0]));
76 
77  // Keystore does not have key
78  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
80 
81  // Keystore has key
82  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
83  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
85  }
86 
87  // P2PKH uncompressed
88  {
89  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
90  keystore.SetupLegacyScriptPubKeyMan();
91  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
92  scriptPubKey = GetScriptForDestination(PKHash(uncompressedPubkey));
93 
94  // Keystore does not have key
95  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
97 
98  // Keystore has key
99  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(uncompressedKey));
100  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
102  }
103 
104  // P2SH
105  {
106  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
107  keystore.SetupLegacyScriptPubKeyMan();
108  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
109 
110  CScript redeemScript = GetScriptForDestination(PKHash(pubkeys[0]));
111  scriptPubKey = GetScriptForDestination(ScriptHash(redeemScript));
112 
113  // Keystore does not have redeemScript or key
114  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
115  BOOST_CHECK_EQUAL(result, ISMINE_NO);
116 
117  // Keystore has redeemScript but no key
118  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(redeemScript));
119  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
120  BOOST_CHECK_EQUAL(result, ISMINE_NO);
121 
122  // Keystore has redeemScript and key
123  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
124  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
126  }
127 
128  // (P2PKH inside) P2SH inside P2SH (invalid)
129  {
130  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
131  keystore.SetupLegacyScriptPubKeyMan();
132  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
133 
134  CScript redeemscript_inner = GetScriptForDestination(PKHash(pubkeys[0]));
135  CScript redeemscript = GetScriptForDestination(ScriptHash(redeemscript_inner));
136  scriptPubKey = GetScriptForDestination(ScriptHash(redeemscript));
137 
138  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(redeemscript));
139  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(redeemscript_inner));
140  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
141  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
142  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
143  BOOST_CHECK_EQUAL(result, ISMINE_NO);
144  }
145 
146  // (P2PKH inside) P2SH inside P2WSH (invalid)
147  {
148  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
149  keystore.SetupLegacyScriptPubKeyMan();
150  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
151 
152  CScript redeemscript = GetScriptForDestination(PKHash(pubkeys[0]));
153  CScript witnessscript = GetScriptForDestination(ScriptHash(redeemscript));
154  scriptPubKey = GetScriptForDestination(WitnessV0ScriptHash(witnessscript));
155 
156  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(witnessscript));
157  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(redeemscript));
158  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
159  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
160  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
161  BOOST_CHECK_EQUAL(result, ISMINE_NO);
162  }
163 
164  // P2WPKH inside P2WSH (invalid)
165  {
166  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
167  keystore.SetupLegacyScriptPubKeyMan();
168  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
169 
170  CScript witnessscript = GetScriptForDestination(WitnessV0KeyHash(pubkeys[0]));
171  scriptPubKey = GetScriptForDestination(WitnessV0ScriptHash(witnessscript));
172 
173  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(witnessscript));
174  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
175  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
176  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
177  BOOST_CHECK_EQUAL(result, ISMINE_NO);
178  }
179 
180  // (P2PKH inside) P2WSH inside P2WSH (invalid)
181  {
182  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
183  keystore.SetupLegacyScriptPubKeyMan();
184  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
185 
186  CScript witnessscript_inner = GetScriptForDestination(PKHash(pubkeys[0]));
187  CScript witnessscript = GetScriptForDestination(WitnessV0ScriptHash(witnessscript_inner));
188  scriptPubKey = GetScriptForDestination(WitnessV0ScriptHash(witnessscript));
189 
190  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(witnessscript_inner));
191  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(witnessscript));
192  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
193  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
194  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
195  BOOST_CHECK_EQUAL(result, ISMINE_NO);
196  }
197 
198  // P2WPKH compressed
199  {
200  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
201  keystore.SetupLegacyScriptPubKeyMan();
202  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
203  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
204 
205  scriptPubKey = GetScriptForDestination(WitnessV0KeyHash(pubkeys[0]));
206 
207  // Keystore implicitly has key and P2SH redeemScript
208  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
209  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
211  }
212 
213  // P2WPKH uncompressed
214  {
215  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
216  keystore.SetupLegacyScriptPubKeyMan();
217  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
218  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(uncompressedKey));
219 
220  scriptPubKey = GetScriptForDestination(WitnessV0KeyHash(uncompressedPubkey));
221 
222  // Keystore has key, but no P2SH redeemScript
223  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
224  BOOST_CHECK_EQUAL(result, ISMINE_NO);
225 
226  // Keystore has key and P2SH redeemScript
227  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
228  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
229  BOOST_CHECK_EQUAL(result, ISMINE_NO);
230  }
231 
232  // scriptPubKey multisig
233  {
234  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
235  keystore.SetupLegacyScriptPubKeyMan();
236  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
237 
238  scriptPubKey = GetScriptForMultisig(2, {uncompressedPubkey, pubkeys[1]});
239 
240  // Keystore does not have any keys
241  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
242  BOOST_CHECK_EQUAL(result, ISMINE_NO);
243 
244  // Keystore has 1/2 keys
245  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(uncompressedKey));
246 
247  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
248  BOOST_CHECK_EQUAL(result, ISMINE_NO);
249 
250  // Keystore has 2/2 keys
251  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[1]));
252 
253  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
254  BOOST_CHECK_EQUAL(result, ISMINE_NO);
255 
256  // Keystore has 2/2 keys and the script
257  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
258 
259  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
260  BOOST_CHECK_EQUAL(result, ISMINE_NO);
261  }
262 
263  // P2SH multisig
264  {
265  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
266  keystore.SetupLegacyScriptPubKeyMan();
267  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
268  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(uncompressedKey));
269  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[1]));
270 
271  CScript redeemScript = GetScriptForMultisig(2, {uncompressedPubkey, pubkeys[1]});
272  scriptPubKey = GetScriptForDestination(ScriptHash(redeemScript));
273 
274  // Keystore has no redeemScript
275  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
276  BOOST_CHECK_EQUAL(result, ISMINE_NO);
277 
278  // Keystore has redeemScript
279  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(redeemScript));
280  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
282  }
283 
284  // P2WSH multisig with compressed keys
285  {
286  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
287  keystore.SetupLegacyScriptPubKeyMan();
288  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
289  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
290  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[1]));
291 
292  CScript witnessScript = GetScriptForMultisig(2, {pubkeys[0], pubkeys[1]});
293  scriptPubKey = GetScriptForDestination(WitnessV0ScriptHash(witnessScript));
294 
295  // Keystore has keys, but no witnessScript or P2SH redeemScript
296  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
297  BOOST_CHECK_EQUAL(result, ISMINE_NO);
298 
299  // Keystore has keys and witnessScript, but no P2SH redeemScript
300  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(witnessScript));
301  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
302  BOOST_CHECK_EQUAL(result, ISMINE_NO);
303 
304  // Keystore has keys, witnessScript, P2SH redeemScript
305  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
306  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
308  }
309 
310  // P2WSH multisig with uncompressed key
311  {
312  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
313  keystore.SetupLegacyScriptPubKeyMan();
314  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
315  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(uncompressedKey));
316  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[1]));
317 
318  CScript witnessScript = GetScriptForMultisig(2, {uncompressedPubkey, pubkeys[1]});
319  scriptPubKey = GetScriptForDestination(WitnessV0ScriptHash(witnessScript));
320 
321  // Keystore has keys, but no witnessScript or P2SH redeemScript
322  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
323  BOOST_CHECK_EQUAL(result, ISMINE_NO);
324 
325  // Keystore has keys and witnessScript, but no P2SH redeemScript
326  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(witnessScript));
327  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
328  BOOST_CHECK_EQUAL(result, ISMINE_NO);
329 
330  // Keystore has keys, witnessScript, P2SH redeemScript
331  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(scriptPubKey));
332  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
333  BOOST_CHECK_EQUAL(result, ISMINE_NO);
334  }
335 
336  // P2WSH multisig wrapped in P2SH
337  {
338  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
339  keystore.SetupLegacyScriptPubKeyMan();
340  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
341 
342  CScript witnessScript = GetScriptForMultisig(2, {pubkeys[0], pubkeys[1]});
343  CScript redeemScript = GetScriptForDestination(WitnessV0ScriptHash(witnessScript));
344  scriptPubKey = GetScriptForDestination(ScriptHash(redeemScript));
345 
346  // Keystore has no witnessScript, P2SH redeemScript, or keys
347  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
348  BOOST_CHECK_EQUAL(result, ISMINE_NO);
349 
350  // Keystore has witnessScript and P2SH redeemScript, but no keys
351  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(redeemScript));
352  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddCScript(witnessScript));
353  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
354  BOOST_CHECK_EQUAL(result, ISMINE_NO);
355 
356  // Keystore has keys, witnessScript, P2SH redeemScript
357  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
358  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[1]));
359  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
361  }
362 
363  // OP_RETURN
364  {
365  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
366  keystore.SetupLegacyScriptPubKeyMan();
367  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
368  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
369 
370  scriptPubKey.clear();
371  scriptPubKey << OP_RETURN << ToByteVector(pubkeys[0]);
372 
373  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
374  BOOST_CHECK_EQUAL(result, ISMINE_NO);
375  }
376 
377  // witness unspendable
378  {
379  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
380  keystore.SetupLegacyScriptPubKeyMan();
381  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
382  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
383 
384  scriptPubKey.clear();
385  scriptPubKey << OP_0 << ToByteVector(ParseHex("aabb"));
386 
387  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
388  BOOST_CHECK_EQUAL(result, ISMINE_NO);
389  }
390 
391  // witness unknown
392  {
393  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
394  keystore.SetupLegacyScriptPubKeyMan();
395  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
396  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
397 
398  scriptPubKey.clear();
399  scriptPubKey << OP_16 << ToByteVector(ParseHex("aabb"));
400 
401  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
402  BOOST_CHECK_EQUAL(result, ISMINE_NO);
403  }
404 
405  // Nonstandard
406  {
407  CWallet keystore(chain.get(), "", CreateDummyWalletDatabase());
408  keystore.SetupLegacyScriptPubKeyMan();
409  LOCK(keystore.GetLegacyScriptPubKeyMan()->cs_KeyStore);
410  BOOST_CHECK(keystore.GetLegacyScriptPubKeyMan()->AddKey(keys[0]));
411 
412  scriptPubKey.clear();
413  scriptPubKey << OP_9 << OP_ADD << OP_11 << OP_EQUAL;
414 
415  result = keystore.GetLegacyScriptPubKeyMan()->IsMine(scriptPubKey);
416  BOOST_CHECK_EQUAL(result, ISMINE_NO);
417  }
418 }
419 
void SetupLegacyScriptPubKeyMan()
Make a LegacyScriptPubKeyMan and set it for all types, internal, and external.
Definition: wallet.cpp:4396
CPubKey GetPubKey() const
Compute the public key from a private key.
Definition: key.cpp:184
std::vector< unsigned char > ParseHex(const char *psz)
CScript GetScriptForRawPubKey(const CPubKey &pubKey)
Generate a P2PK script for the given pubkey.
Definition: standard.cpp:300
Definition: script.h:80
std::unique_ptr< Chain > MakeChain(NodeContext &node)
Return implementation of Chain interface.
Definition: chain.cpp:415
NodeContext struct containing references to chain state and connection state.
Definition: context.h:36
BOOST_AUTO_TEST_CASE(ismine_standard)
#define LOCK(cs)
Definition: sync.h:230
An encapsulated public key.
Definition: pubkey.h:30
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
Definition: key.cpp:157
isminetype
IsMine() return codes.
Definition: ismine.h:18
std::unique_ptr< WalletDatabase > CreateDummyWalletDatabase()
Return object for accessing dummy database with no read/write capabilities.
Definition: walletdb.cpp:1036
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
Definition: standard.cpp:295
Definition: script.h:73
#define BOOST_FIXTURE_TEST_SUITE(a, b)
Definition: object.cpp:14
#define BOOST_CHECK_EQUAL(v1, v2)
Definition: object.cpp:18
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:390
#define BOOST_AUTO_TEST_SUITE_END()
Definition: object.cpp:16
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:622
CScript GetScriptForMultisig(int nRequired, const std::vector< CPubKey > &keys)
Generate a multisig script.
Definition: standard.cpp:305
An encapsulated private key.
Definition: key.h:27
Definition: script.h:75
Definition: script.h:57
void clear()
Definition: script.h:534
Definition: script.h:142
#define BOOST_CHECK(expr)
Definition: object.cpp:17
std::vector< unsigned char > ToByteVector(const T &in)
Definition: script.h:48