Browse Source

Export comment on HDSeed and fingerprint with wallet

metaverse
Eirik Ogilvie-Wigley 6 years ago
parent
commit
ae807af413
  1. 4
      qa/rpc-tests/wallet_import_export.py
  2. 6
      src/wallet/rpcdump.cpp

4
qa/rpc-tests/wallet_import_export.py

@ -42,7 +42,9 @@ class WalletImportExportTest (BitcoinTestFramework):
# Helper functions
def parse_wallet_file(dump_path):
file_lines = open(dump_path, "r").readlines()
# WE expect information about the HDSeed and fingerpring in the header
assert_true("HDSeed" in file_lines[4], "Expected HDSeed")
assert_true("fingerprint" in file_lines[4], "Expected fingerprint")
(t_keys, i) = parse_wallet_file_lines(file_lines, 0)
(sprout_keys, i) = parse_wallet_file_lines(file_lines, i)
(sapling_keys, i) = parse_wallet_file_lines(file_lines, i)

6
src/wallet/rpcdump.cpp

@ -502,6 +502,12 @@ UniValue dumpwallet_impl(const UniValue& params, bool fHelp, bool fDumpZKeys)
file << strprintf("# * Created on %s\n", EncodeDumpTime(GetTime()));
file << strprintf("# * Best block at time of backup was %i (%s),\n", chainActive.Height(), chainActive.Tip()->GetBlockHash().ToString());
file << strprintf("# mined on %s\n", EncodeDumpTime(chainActive.Tip()->GetBlockTime()));
{
HDSeed hdSeed;
pwalletMain->GetHDSeed(hdSeed);
file << strprintf("# HDSeed=%s fingerprint=%s", pwalletMain->GetHDChain().seedFp.GetHex(), hdSeed.Fingerprint().GetHex());
file << "\n";
}
file << "\n";
for (std::vector<std::pair<int64_t, CKeyID> >::const_iterator it = vKeyBirth.begin(); it != vKeyBirth.end(); it++) {
const CKeyID &keyid = it->second;

Loading…
Cancel
Save