Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115588
D6004.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
D6004.diff
View Options
diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h
--- a/src/wallet/walletdb.h
+++ b/src/wallet/walletdb.h
@@ -170,6 +170,8 @@
bool WriteTx(const CWalletTx &wtx);
bool EraseTx(uint256 hash);
+ bool WriteKeyMetadata(const CKeyMetadata &meta, const CPubKey &pubkey,
+ const bool overwrite);
bool WriteKey(const CPubKey &vchPubKey, const CPrivKey &vchPrivKey,
const CKeyMetadata &keyMeta);
bool WriteCryptedKey(const CPubKey &vchPubKey,
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -72,10 +72,16 @@
return EraseIC(std::make_pair(std::string("tx"), hash));
}
+bool WalletBatch::WriteKeyMetadata(const CKeyMetadata &meta,
+ const CPubKey &pubkey,
+ const bool overwrite) {
+ return WriteIC(std::make_pair(std::string("keymeta"), pubkey), meta,
+ overwrite);
+}
+
bool WalletBatch::WriteKey(const CPubKey &vchPubKey, const CPrivKey &vchPrivKey,
const CKeyMetadata &keyMeta) {
- if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta,
- false)) {
+ if (!WriteKeyMetadata(keyMeta, vchPubKey, false)) {
return false;
}
@@ -93,7 +99,7 @@
bool WalletBatch::WriteCryptedKey(const CPubKey &vchPubKey,
const std::vector<uint8_t> &vchCryptedSecret,
const CKeyMetadata &keyMeta) {
- if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) {
+ if (!WriteKeyMetadata(keyMeta, vchPubKey, true)) {
return false;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:28 (8 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5184796
Default Alt Text
D6004.diff (1 KB)
Attached To
D6004: Refactor keymetadata writing to a separate method
Event Timeline
Log In to Comment