aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-02-18 10:47:25 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-16 10:32:29 +0000
commit5f146873c58f39632e26c5edbf2f618cacbd76a5 (patch)
tree934c7eb0e55195c8ab3e19ae606522bf4f5db87c /src/wallet/wallet2.h
parentadd RPC to get a histogram of outputs of a given amount (diff)
downloadmonero-5f146873c58f39632e26c5edbf2f618cacbd76a5.tar.xz
wallet: add shared ring database
This maps key images to rings, so that different forks can reuse the rings by key image. This avoids revealing the real inputs like would happen if two forks spent the same outputs with different rings. This database is meant to be shared with all Monero forks which don't bother making a new chain, putting users' privacy at risk in the process. It is placed in a shared data directory by default ($HOME/.shared-ringdb on UNIX like systems). You may use --shared-ringdb-dir to override this location, and should then do so for all Monero forks for them to share the database.
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index 2a883dce7..79686753b 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -810,6 +810,9 @@ namespace tools
if(ver < 23)
return;
a & m_account_tags;
+ if(ver < 24)
+ return;
+ a & m_ring_history_saved;
}
/*!
@@ -1046,6 +1049,11 @@ namespace tools
return epee::net_utils::invoke_http_json_rpc(uri, method_name, req, res, m_http_client, timeout, http_method, req_id);
}
+ void set_ring_database(const std::string &filename);
+ const std::string get_ring_database() const { return m_ring_database; }
+ bool get_ring(const std::string &filename, const crypto::key_image &key_image, std::vector<uint64_t> &outs);
+ bool find_and_save_rings(const std::string &filename, bool force = true);
+
private:
/*!
* \brief Stores wallet information to wallet file.
@@ -1102,6 +1110,10 @@ namespace tools
rct::multisig_kLRki get_multisig_kLRki(size_t n, const rct::key &k) const;
rct::key get_multisig_k(size_t idx, const std::unordered_set<rct::key> &used_L) const;
void update_multisig_rescan_info(const std::vector<std::vector<rct::key>> &multisig_k, const std::vector<std::vector<tools::wallet2::multisig_info>> &info, size_t n);
+ bool add_rings(const std::string &filename, const crypto::chacha_key &key, const cryptonote::transaction_prefix &tx);
+ bool add_rings(const std::string &filename, const cryptonote::transaction_prefix &tx);
+ bool remove_rings(const std::string &filename, const cryptonote::transaction_prefix &tx);
+ bool get_ring(const std::string &filename, const crypto::chacha_key &key, const crypto::key_image &key_image, std::vector<uint64_t> &outs);
bool get_output_distribution(uint64_t &start_height, std::vector<uint64_t> &distribution);
@@ -1187,9 +1199,12 @@ namespace tools
std::unordered_map<crypto::hash, address_tx> m_light_wallet_address_txs;
// store calculated key image for faster lookup
std::unordered_map<crypto::public_key, std::map<uint64_t, crypto::key_image> > m_key_image_cache;
+
+ std::string m_ring_database;
+ bool m_ring_history_saved;
};
}
-BOOST_CLASS_VERSION(tools::wallet2, 23)
+BOOST_CLASS_VERSION(tools::wallet2, 24)
BOOST_CLASS_VERSION(tools::wallet2::transfer_details, 9)
BOOST_CLASS_VERSION(tools::wallet2::multisig_info, 1)
BOOST_CLASS_VERSION(tools::wallet2::multisig_info::LR, 0)