aboutsummaryrefslogtreecommitdiff
path: root/src/walletdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/walletdb.cpp')
-rw-r--r--src/walletdb.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/walletdb.cpp b/src/walletdb.cpp
index 9c5bddba60..2e61c6cd58 100644
--- a/src/walletdb.cpp
+++ b/src/walletdb.cpp
@@ -564,6 +564,18 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
{
ssValue >> pwallet->nOrderPosNext;
}
+ else if (strType == "destdata")
+ {
+ std::string strAddress, strKey, strValue;
+ ssKey >> strAddress;
+ ssKey >> strKey;
+ ssValue >> strValue;
+ if (!pwallet->LoadDestData(CBitcoinAddress(strAddress).Get(), strKey, strValue))
+ {
+ strErr = "Error reading wallet database: LoadDestData failed";
+ return false;
+ }
+ }
} catch (...)
{
return false;
@@ -865,3 +877,15 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename)
{
return CWalletDB::Recover(dbenv, filename, false);
}
+
+bool CWalletDB::WriteDestData(const std::string &address, const std::string &key, const std::string &value)
+{
+ nWalletDBUpdated++;
+ return Write(boost::make_tuple(std::string("destdata"), address, key), value);
+}
+
+bool CWalletDB::EraseDestData(const std::string &address, const std::string &key)
+{
+ nWalletDBUpdated++;
+ return Erase(boost::make_tuple(string("destdata"), address, key));
+}