aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcdump.cpp
diff options
context:
space:
mode:
authorMeshCollider <dobsonsa68@gmail.com>2017-11-11 21:21:12 +1300
committerMeshCollider <dobsonsa68@gmail.com>2017-12-20 18:47:56 +1300
commitb702ae812c88fb6ccc4b5163383d96997004c3c8 (patch)
treeca38218d93f974e0aa9df59e5e88f822e75e082c /src/wallet/rpcdump.cpp
parentcdc260afd530165a3167e049b630bc177a1398f9 (diff)
downloadbitcoin-b702ae812c88fb6ccc4b5163383d96997004c3c8.tar.xz
Add CScripts to dumpwallet RPC
Diffstat (limited to 'src/wallet/rpcdump.cpp')
-rw-r--r--src/wallet/rpcdump.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp
index 6ca947bf1b..29f5a0da94 100644
--- a/src/wallet/rpcdump.cpp
+++ b/src/wallet/rpcdump.cpp
@@ -640,6 +640,8 @@ UniValue dumpwallet(const JSONRPCRequest& request)
const std::map<CKeyID, int64_t>& mapKeyPool = pwallet->GetAllReserveKeys();
pwallet->GetKeyBirthTimes(mapKeyBirth);
+ std::set<CScriptID> scripts = pwallet->GetCScripts();
+
// sort time/key pairs
std::vector<std::pair<int64_t, CKeyID> > vKeyBirth;
for (const auto& entry : mapKeyBirth) {
@@ -694,6 +696,15 @@ UniValue dumpwallet(const JSONRPCRequest& request)
}
}
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.close();