mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
[wallet] Cache keyid -> keypool id mappings
This commit is contained in:
@@ -619,9 +619,8 @@ UniValue dumpwallet(const JSONRPCRequest& request)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file");
|
||||
|
||||
std::map<CTxDestination, int64_t> mapKeyBirth;
|
||||
std::set<CKeyID> setKeyPool;
|
||||
const std::map<CKeyID, int64_t>& mapKeyPool = pwallet->GetAllReserveKeys();
|
||||
pwallet->GetKeyBirthTimes(mapKeyBirth);
|
||||
pwallet->GetAllReserveKeys(setKeyPool);
|
||||
|
||||
// sort time/key pairs
|
||||
std::vector<std::pair<int64_t, CKeyID> > vKeyBirth;
|
||||
@@ -666,7 +665,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
|
||||
file << strprintf("label=%s", EncodeDumpString(pwallet->mapAddressBook[keyid].name));
|
||||
} else if (keyid == masterKeyID) {
|
||||
file << "hdmaster=1";
|
||||
} else if (setKeyPool.count(keyid)) {
|
||||
} else if (mapKeyPool.count(keyid)) {
|
||||
file << "reserve=1";
|
||||
} else if (pwallet->mapKeyMetadata[keyid].hdKeypath == "m") {
|
||||
file << "inactivehdmaster=1";
|
||||
|
||||
Reference in New Issue
Block a user