Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115585
D6229.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D6229.diff
View Options
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -1442,6 +1442,11 @@
*/
bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const override;
+ /**
+ * Add a KeyOriginInfo to the wallet
+ */
+ bool AddKeyOrigin(const CPubKey &pubkey, const KeyOriginInfo &info);
+
friend struct WalletTestingSetup;
};
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4976,3 +4976,13 @@
}
return true;
}
+
+bool CWallet::AddKeyOrigin(const CPubKey &pubkey, const KeyOriginInfo &info) {
+ LOCK(cs_wallet);
+ std::copy(info.fingerprint, info.fingerprint + 4,
+ mapKeyMetadata[pubkey.GetID()].key_origin.fingerprint);
+ mapKeyMetadata[pubkey.GetID()].key_origin.path = info.path;
+ mapKeyMetadata[pubkey.GetID()].has_key_origin = true;
+ mapKeyMetadata[pubkey.GetID()].hdKeypath = WriteHDKeypath(info.path);
+ return WriteKeyMetadata(mapKeyMetadata[pubkey.GetID()], pubkey, true);
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:28 (8 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187611
Default Alt Text
D6229.diff (1 KB)
Attached To
D6229: Implement a function to add KeyOriginInfo to a wallet
Event Timeline
Log In to Comment