mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-12 16:17:53 +00:00
Add CScripts to dumpwallet RPC
This commit is contained in:
parent
cdc260afd5
commit
b702ae812c
@ -640,6 +640,8 @@ UniValue dumpwallet(const JSONRPCRequest& request)
|
|||||||
const std::map<CKeyID, int64_t>& mapKeyPool = pwallet->GetAllReserveKeys();
|
const std::map<CKeyID, int64_t>& mapKeyPool = pwallet->GetAllReserveKeys();
|
||||||
pwallet->GetKeyBirthTimes(mapKeyBirth);
|
pwallet->GetKeyBirthTimes(mapKeyBirth);
|
||||||
|
|
||||||
|
std::set<CScriptID> scripts = pwallet->GetCScripts();
|
||||||
|
|
||||||
// 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) {
|
||||||
@ -694,6 +696,15 @@ UniValue dumpwallet(const JSONRPCRequest& request)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file << "\n";
|
file << "\n";
|
||||||
|
for (const CScriptID &scriptid : scripts) {
|
||||||
|
CScript script;
|
||||||
|
std::string address = EncodeDestination(scriptid);
|
||||||
|
if(pwallet->GetCScript(scriptid, script)) {
|
||||||
|
file << strprintf("%s 0 script=1", HexStr(script.begin(), script.end()));
|
||||||
|
file << strprintf(" # addr=%s\n", address);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file << "\n";
|
||||||
file << "# End of dump\n";
|
file << "# End of dump\n";
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user