Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 915 Lines • ▼ Show 20 Lines | UniValue dumpwallet(const Config &config, const JSONRPCRequest &request) { | ||||
file.open(filepath.string().c_str()); | file.open(filepath.string().c_str()); | ||||
if (!file.is_open()) { | if (!file.is_open()) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Cannot open wallet dump file"); | "Cannot open wallet dump file"); | ||||
} | } | ||||
std::map<CTxDestination, int64_t> mapKeyBirth; | std::map<CTxDestination, int64_t> mapKeyBirth; | ||||
const std::map<CKeyID, int64_t> &mapKeyPool = pwallet->GetAllReserveKeys(); | const std::map<CKeyID, int64_t> &mapKeyPool = pwallet->GetAllReserveKeys(); | ||||
pwallet->GetKeyBirthTimes(mapKeyBirth); | pwallet->GetKeyBirthTimes(*locked_chain, mapKeyBirth); | ||||
std::set<CScriptID> scripts = pwallet->GetCScripts(); | std::set<CScriptID> scripts = pwallet->GetCScripts(); | ||||
// TODO: include scripts in GetKeyBirthTimes() output instead of separate | // TODO: include scripts in GetKeyBirthTimes() output instead of separate | ||||
// sort time/key pairs | // sort time/key pairs | ||||
std::vector<std::pair<int64_t, CKeyID>> vKeyBirth; | std::vector<std::pair<int64_t, CKeyID>> vKeyBirth; | ||||
for (const auto &entry : mapKeyBirth) { | for (const auto &entry : mapKeyBirth) { | ||||
if (const CKeyID *keyID = boost::get<CKeyID>(&entry.first)) { | if (const CKeyID *keyID = boost::get<CKeyID>(&entry.first)) { | ||||
▲ Show 20 Lines • Show All 658 Lines • Show Last 20 Lines |