Page MenuHomePhabricator

D6004.diff
No OneTemporary

D6004.diff

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

Mime Type
text/plain
Expires
Sat, Mar 1, 11:28 (5 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5184796
Default Alt Text
D6004.diff (1 KB)

Event Timeline