aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-04 13:30:40 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-16 10:32:54 +0000
commit504428ab4a7aa7773832acdc3de0baad22d6b9b7 (patch)
treee0c46debfa497a3110e5fce39c0729f2c5f4aaf2 /src/wallet/wallet2.cpp
parentwallet: add a set_ring command (diff)
downloadmonero-504428ab4a7aa7773832acdc3de0baad22d6b9b7.tar.xz
ringdb: use the genesis block as a db name
This will avoid careless forkers polluting the shared database even if they make their own chain. They'll then automatically start using another subdb, and any key-reusing fork of those forks will reuse their subdbs.
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index b2cbd416b..3d28e80ef 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -5454,8 +5454,10 @@ void wallet2::set_ring_database(const std::string &filename)
m_ring_database = filename;
MINFO("ringdb path set to " << filename);
m_ringdb.reset();
+ cryptonote::block b;
+ generate_genesis(b);
if (!m_ring_database.empty())
- m_ringdb.reset(new tools::ringdb(m_ring_database));
+ m_ringdb.reset(new tools::ringdb(m_ring_database, epee::string_tools::pod_to_hex(get_block_hash(b))));
}
bool wallet2::add_rings(const crypto::chacha_key &key, const cryptonote::transaction_prefix &tx)