[Wallet] add HD xpriv to dumpwallet
Zcash: Only the refactor and addition of hdkeypath to transparent keys. (cherry picked from commit bitcoin/bitcoin@77c912d21c)
This commit is contained in:
parent
28210791a1
commit
eaf8eb40f4
|
@ -649,13 +649,15 @@ UniValue dumpwallet_impl(const UniValue& params, bool fDumpZKeys)
|
||||||
std::string strAddr = keyIO.EncodeDestination(keyid);
|
std::string strAddr = keyIO.EncodeDestination(keyid);
|
||||||
CKey key;
|
CKey key;
|
||||||
if (pwalletMain->GetKey(keyid, key)) {
|
if (pwalletMain->GetKey(keyid, key)) {
|
||||||
|
file << strprintf("%s %s ", keyIO.EncodeSecret(key), strTime);
|
||||||
if (pwalletMain->mapAddressBook.count(keyid)) {
|
if (pwalletMain->mapAddressBook.count(keyid)) {
|
||||||
file << strprintf("%s %s label=%s # addr=%s\n", keyIO.EncodeSecret(key), strTime, EncodeDumpString(pwalletMain->mapAddressBook[keyid].name), strAddr);
|
file << strprintf("label=%s", EncodeDumpString(pwalletMain->mapAddressBook[keyid].name));
|
||||||
} else if (setKeyPool.count(keyid)) {
|
} else if (setKeyPool.count(keyid)) {
|
||||||
file << strprintf("%s %s reserve=1 # addr=%s\n", keyIO.EncodeSecret(key), strTime, strAddr);
|
file << "reserve=1";
|
||||||
} else {
|
} else {
|
||||||
file << strprintf("%s %s change=1 # addr=%s\n", keyIO.EncodeSecret(key), strTime, strAddr);
|
file << "change=1";
|
||||||
}
|
}
|
||||||
|
file << strprintf(" # addr=%s%s\n", strAddr, (pwalletMain->mapKeyMetadata[keyid].hdKeypath.size() > 0 ? " hdkeypath="+pwalletMain->mapKeyMetadata[keyid].hdKeypath : ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file << "\n";
|
file << "\n";
|
||||||
|
|
Loading…
Reference in New Issue