Auto merge of #3587 - Eirik0:3586-fix-dump-comment, r=ebfull

Fix HDSeed comment in wallet dump

Closes #3586
This commit is contained in:
Homu 2018-10-10 16:34:49 -07:00
commit 807fb7497f
2 changed files with 4 additions and 1 deletions

View File

@ -61,6 +61,8 @@ def parse_wallet_file(dump_path):
# 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")
seed_comment_line = file_lines[4][2:].split() # ["HDSeed=...", "fingerprint=..."]
assert_true(seed_comment_line[0].split("=")[1] != seed_comment_line[1].split("=")[1], "The seed should not equal the 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)

View File

@ -508,7 +508,8 @@ UniValue dumpwallet_impl(const UniValue& params, bool fHelp, bool fDumpZKeys)
{
HDSeed hdSeed;
pwalletMain->GetHDSeed(hdSeed);
file << strprintf("# HDSeed=%s fingerprint=%s", pwalletMain->GetHDChain().seedFp.GetHex(), hdSeed.Fingerprint().GetHex());
auto rawSeed = hdSeed.RawSeed();
file << strprintf("# HDSeed=%s fingerprint=%s", HexStr(rawSeed.begin(), rawSeed.end()), hdSeed.Fingerprint().GetHex());
file << "\n";
}
file << "\n";