| 43 | } |
| 44 | |
| 45 | void CHDChain::Debug(std::string strName) const |
| 46 | { |
| 47 | DEBUG_SECTION( |
| 48 | std::cout << __func__ << ": ---" << strName << "---" << std::endl; |
| 49 | if (fCrypted) { |
| 50 | std::cout << "mnemonic: ***CRYPTED***" << std::endl; |
| 51 | std::cout << "mnemonicpassphrase: ***CRYPTED***" << std::endl; |
| 52 | std::cout << "seed: ***CRYPTED***" << std::endl; |
| 53 | } else { |
| 54 | std::cout << "mnemonic: " << std::string(vchMnemonic.begin(), vchMnemonic.end()).c_str() << std::endl; |
| 55 | std::cout << "mnemonicpassphrase: " << std::string(vchMnemonicPassphrase.begin(), vchMnemonicPassphrase.end()).c_str() << std::endl; |
| 56 | std::cout << "seed: " << HexStr(vchSeed).c_str() << std::endl; |
| 57 | |
| 58 | CExtKey extkey; |
| 59 | extkey.SetMaster(&vchSeed[0], vchSeed.size()); |
| 60 | |
| 61 | CBitcoinExtKey b58extkey; |
| 62 | b58extkey.SetKey(extkey); |
| 63 | std::cout << "extended private masterkey: " << b58extkey.ToString().c_str() << std::endl; |
| 64 | |
| 65 | CExtPubKey extpubkey; |
| 66 | extpubkey = extkey.Neuter(); |
| 67 | |
| 68 | CBitcoinExtPubKey b58extpubkey; |
| 69 | b58extpubkey.SetKey(extpubkey); |
| 70 | std::cout << "extended public masterkey: " << b58extpubkey.ToString().c_str() << std::endl; |
| 71 | } |
| 72 | ); |
| 73 | } |
| 74 | |
| 75 | bool CHDChain::SetMnemonic(const SecureVector& vchMnemonic, const SecureVector& vchMnemonicPassphrase, bool fUpdateID) |
| 76 | { |