Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115617
D6416.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D6416.diff
View Options
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp
--- a/src/wallet/rpcdump.cpp
+++ b/src/wallet/rpcdump.cpp
@@ -760,22 +760,22 @@
CPubKey pubkey = key.GetPubKey();
assert(key.VerifyPubKey(pubkey));
CKeyID keyid = pubkey.GetID();
- if (pwallet->HaveKey(keyid)) {
- pwallet->WalletLogPrintf(
- "Skipping import of %s (key already present)\n",
- EncodeDestination(PKHash(keyid), config));
- continue;
- }
+
pwallet->WalletLogPrintf("Importing %s...\n",
EncodeDestination(PKHash(keyid), config));
- if (!pwallet->AddKeyPubKey(key, pubkey)) {
+
+ if (!pwallet->ImportPrivKeys({{keyid, key}}, time)) {
+ pwallet->WalletLogPrintf(
+ "Error importing key for %s\n",
+ EncodeDestination(PKHash(keyid), config));
fGood = false;
continue;
}
- pwallet->mapKeyMetadata[keyid].nCreateTime = time;
+
if (has_label) {
pwallet->SetAddressBook(PKHash(keyid), label, "receive");
}
+
nTimeBegin = std::min(nTimeBegin, time);
progress++;
}
@@ -786,28 +786,22 @@
false);
const CScript &script = script_pair.first;
int64_t time = script_pair.second;
- CScriptID id(script);
- if (pwallet->HaveCScript(id)) {
- pwallet->WalletLogPrintf(
- "Skipping import of %s (script already present)\n",
- HexStr(script));
- continue;
- }
- if (!pwallet->AddCScript(script)) {
+
+ if (!pwallet->ImportScripts({script}, time)) {
pwallet->WalletLogPrintf("Error importing script %s\n",
HexStr(script));
fGood = false;
continue;
}
if (time > 0) {
- pwallet->m_script_metadata[id].nCreateTime = time;
nTimeBegin = std::min(nTimeBegin, time);
}
+
progress++;
}
+
// hide progress dialog in GUI
pwallet->chain().showProgress("", 100, false);
- pwallet->UpdateTimeFirstKey(nTimeBegin);
}
// hide progress dialog in GUI
pwallet->chain().showProgress("", 100, false);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:33 (5 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5186793
Default Alt Text
D6416.diff (2 KB)
Attached To
D6416: Have importwallet use ImportPrivKeys and ImportScripts
Event Timeline
Log In to Comment