diff --git a/nano/node/lmdb/lmdb.cpp b/nano/node/lmdb/lmdb.cpp index e1bc0b7d..6210b839 100644 --- a/nano/node/lmdb/lmdb.cpp +++ b/nano/node/lmdb/lmdb.cpp @@ -212,7 +212,7 @@ void nano::lmdb::store::open_databases (bool & error_a, nano::transaction const { error_a |= mdb_dbi_open (env.tx (transaction_a), "frontiers", flags, &frontier_store.frontiers_handle) != 0; error_a |= mdb_dbi_open (env.tx (transaction_a), "unchecked", flags, &unchecked_handle) != 0; - error_a |= mdb_dbi_open (env.tx (transaction_a), "online_weight", flags, &online_weight_handle) != 0; + error_a |= mdb_dbi_open (env.tx (transaction_a), "online_weight", flags, &online_weight_store.online_weight_handle) != 0; error_a |= mdb_dbi_open (env.tx (transaction_a), "meta", flags, &meta_handle) != 0; error_a |= mdb_dbi_open (env.tx (transaction_a), "peers", flags, &peers_handle) != 0; error_a |= mdb_dbi_open (env.tx (transaction_a), "pruned", flags, &pruned_handle) != 0; @@ -871,7 +871,7 @@ MDB_dbi nano::lmdb::store::table_to_dbi (tables table_a) const case tables::unchecked: return unchecked_handle; case tables::online_weight: - return online_weight_handle; + return online_weight_store.online_weight_handle; case tables::meta: return meta_handle; case tables::peers: diff --git a/nano/node/lmdb/lmdb.hpp b/nano/node/lmdb/lmdb.hpp index a1932346..269ecc33 100644 --- a/nano/node/lmdb/lmdb.hpp +++ b/nano/node/lmdb/lmdb.hpp @@ -142,12 +142,6 @@ namespace lmdb */ MDB_dbi unchecked_handle{ 0 }; - /** - * Samples of online vote weight - * uint64_t -> nano::amount - */ - MDB_dbi online_weight_handle{ 0 }; - /** * Meta information about block store, such as versions. * nano::uint256_union (arbitrary key) -> blob diff --git a/nano/node/lmdb/online_weight_store.hpp b/nano/node/lmdb/online_weight_store.hpp index ba463710..88ed78c5 100644 --- a/nano/node/lmdb/online_weight_store.hpp +++ b/nano/node/lmdb/online_weight_store.hpp @@ -2,6 +2,8 @@ #include +#include + namespace nano { namespace lmdb @@ -20,6 +22,12 @@ namespace lmdb nano::store_iterator end () const override; size_t count (nano::transaction const & transaction_a) const override; void clear (nano::write_transaction const & transaction_a) override; + + /** + * Samples of online vote weight + * uint64_t -> nano::amount + */ + MDB_dbi online_weight_handle{ 0 }; }; } }