From b10e147096b0e27fdff8c22029bc8b7a1a14f042 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 18 Nov 2013 16:55:54 +0100 Subject: wallet: add interface for storing generic data on destinations --- src/wallet.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/wallet.h') diff --git a/src/wallet.h b/src/wallet.h index e4452a3093..dc8c007ac8 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -83,6 +83,9 @@ public: { purpose = "unknown"; } + + typedef std::map StringMap; + StringMap destdata; }; /** A CWallet is an extension of a keystore, which also maintains a set of transactions and balances, @@ -189,6 +192,15 @@ public: bool AddCScript(const CScript& redeemScript); bool LoadCScript(const CScript& redeemScript) { return CCryptoKeyStore::AddCScript(redeemScript); } + /// Adds a destination data tuple to the store, and saves it to disk + bool AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value); + /// Erases a destination data tuple in the store and on disk + bool EraseDestData(const CTxDestination &dest, const std::string &key); + /// Adds a destination data tuple to the store, without saving it to disk + bool LoadDestData(const CTxDestination &dest, const std::string &key, const std::string &value); + /// Look up a destination data tuple in the store, return true if found false otherwise + bool GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const; + bool Unlock(const SecureString& strWalletPassphrase); bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase); bool EncryptWallet(const SecureString& strWalletPassphrase); -- cgit v1.2.3