aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcdump.cpp
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2019-02-19 17:00:45 -0500
committerGregory Sanders <gsanders87@gmail.com>2019-04-29 10:15:23 -0400
commit70946e7fee54323ce6a5ea8aeb377e2c7c790bc6 (patch)
tree8214716fc7275e3b32bc0c28bdfab5df44ad6a4f /src/wallet/rpcdump.cpp
parentcaceff55465e392dfd1b0ba9225653b64d8518f1 (diff)
downloadbitcoin-70946e7fee54323ce6a5ea8aeb377e2c7c790bc6.tar.xz
Replace CScriptID and CKeyID in CTxDestination with dedicated types
Diffstat (limited to 'src/wallet/rpcdump.cpp')
-rw-r--r--src/wallet/rpcdump.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp
index c339e111ba..6d54522ad4 100644
--- a/src/wallet/rpcdump.cpp
+++ b/src/wallet/rpcdump.cpp
@@ -252,7 +252,7 @@ static void ImportScript(CWallet* const pwallet, const CScript& script, const st
if (!pwallet->HaveCScript(id) && !pwallet->AddCScript(script)) {
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding p2sh redeemScript to wallet");
}
- ImportAddress(pwallet, id, strLabel);
+ ImportAddress(pwallet, ScriptHash(id), strLabel);
} else {
CTxDestination destination;
if (ExtractDestination(script, destination)) {
@@ -661,17 +661,17 @@ UniValue importwallet(const JSONRPCRequest& request)
assert(key.VerifyPubKey(pubkey));
CKeyID keyid = pubkey.GetID();
if (pwallet->HaveKey(keyid)) {
- pwallet->WalletLogPrintf("Skipping import of %s (key already present)\n", EncodeDestination(keyid));
+ pwallet->WalletLogPrintf("Skipping import of %s (key already present)\n", EncodeDestination(PKHash(keyid)));
continue;
}
- pwallet->WalletLogPrintf("Importing %s...\n", EncodeDestination(keyid));
+ pwallet->WalletLogPrintf("Importing %s...\n", EncodeDestination(PKHash(keyid)));
if (!pwallet->AddKeyPubKey(key, pubkey)) {
fGood = false;
continue;
}
pwallet->mapKeyMetadata[keyid].nCreateTime = time;
if (has_label)
- pwallet->SetAddressBook(keyid, label, "receive");
+ pwallet->SetAddressBook(PKHash(keyid), label, "receive");
nTimeBegin = std::min(nTimeBegin, time);
progress++;
}
@@ -817,8 +817,8 @@ UniValue dumpwallet(const JSONRPCRequest& request)
// sort time/key pairs
std::vector<std::pair<int64_t, CKeyID> > vKeyBirth;
for (const auto& entry : mapKeyBirth) {
- if (const CKeyID* keyID = boost::get<CKeyID>(&entry.first)) { // set and test
- vKeyBirth.push_back(std::make_pair(entry.second, *keyID));
+ if (const PKHash* keyID = boost::get<PKHash>(&entry.first)) { // set and test
+ vKeyBirth.push_back(std::make_pair(entry.second, CKeyID(*keyID)));
}
}
mapKeyBirth.clear();
@@ -870,7 +870,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
for (const CScriptID &scriptid : scripts) {
CScript script;
std::string create_time = "0";
- std::string address = EncodeDestination(scriptid);
+ std::string address = EncodeDestination(ScriptHash(scriptid));
// get birth times for scripts with metadata
auto it = pwallet->m_script_metadata.find(scriptid);
if (it != pwallet->m_script_metadata.end()) {