mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
GetKeyBirthTimes should return key ids, not destinations
This commit is contained in:
@@ -807,19 +807,16 @@ UniValue dumpwallet(const JSONRPCRequest& request)
|
||||
if (!file.is_open())
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file");
|
||||
|
||||
std::map<CTxDestination, int64_t> mapKeyBirth;
|
||||
std::map<CKeyID, int64_t> mapKeyBirth;
|
||||
const std::map<CKeyID, int64_t>& mapKeyPool = pwallet->GetAllReserveKeys();
|
||||
pwallet->GetKeyBirthTimes(*locked_chain, mapKeyBirth);
|
||||
|
||||
std::set<CScriptID> scripts = pwallet->GetCScripts();
|
||||
// TODO: include scripts in GetKeyBirthTimes() output instead of separate
|
||||
|
||||
// sort time/key pairs
|
||||
std::vector<std::pair<int64_t, CKeyID> > vKeyBirth;
|
||||
for (const auto& entry : mapKeyBirth) {
|
||||
if (const PKHash* keyID = boost::get<PKHash>(&entry.first)) { // set and test
|
||||
vKeyBirth.push_back(std::make_pair(entry.second, CKeyID(*keyID)));
|
||||
}
|
||||
vKeyBirth.push_back(std::make_pair(entry.second, entry.first));
|
||||
}
|
||||
mapKeyBirth.clear();
|
||||
std::sort(vKeyBirth.begin(), vKeyBirth.end());
|
||||
|
||||
Reference in New Issue
Block a user