diff options
Diffstat (limited to 'src/dbwrapper.h')
-rw-r--r-- | src/dbwrapper.h | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/src/dbwrapper.h b/src/dbwrapper.h index 1109cb5888..665eaa0e98 100644 --- a/src/dbwrapper.h +++ b/src/dbwrapper.h @@ -7,14 +7,26 @@ #include <clientversion.h> #include <fs.h> +#include <logging.h> #include <serialize.h> #include <span.h> #include <streams.h> -#include <util/strencodings.h> -#include <util/system.h> +#include <cstddef> +#include <cstdint> +#include <exception> #include <leveldb/db.h> +#include <leveldb/iterator.h> +#include <leveldb/options.h> +#include <leveldb/slice.h> +#include <leveldb/status.h> #include <leveldb/write_batch.h> +#include <stdexcept> +#include <string> +#include <vector> +namespace leveldb { +class Env; +} static const size_t DBWRAPPER_PREALLOC_KEY_SIZE = 64; static const size_t DBWRAPPER_PREALLOC_VALUE_SIZE = 1024; @@ -166,11 +178,6 @@ public: } return true; } - - unsigned int GetValueSize() { - return piter->value().size(); - } - }; class CDBWrapper @@ -318,22 +325,6 @@ public: pdb->GetApproximateSizes(&range, 1, &size); return size; } - - /** - * Compact a certain range of keys in the database. - */ - template<typename K> - void CompactRange(const K& key_begin, const K& key_end) const - { - CDataStream ssKey1(SER_DISK, CLIENT_VERSION), ssKey2(SER_DISK, CLIENT_VERSION); - ssKey1.reserve(DBWRAPPER_PREALLOC_KEY_SIZE); - ssKey2.reserve(DBWRAPPER_PREALLOC_KEY_SIZE); - ssKey1 << key_begin; - ssKey2 << key_end; - leveldb::Slice slKey1((const char*)ssKey1.data(), ssKey1.size()); - leveldb::Slice slKey2((const char*)ssKey2.data(), ssKey2.size()); - pdb->CompactRange(&slKey1, &slKey2); - } }; #endif // BITCOIN_DBWRAPPER_H |