Skip to content

Commit 6ec4b7e

Browse files
committed
leveldbwrapper: Remove unused .Prev(), .SeekToLast() methods
Also, trim trailing whitespace.
1 parent a092970 commit 6ec4b7e

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

src/leveldbwrapper.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ CLevelDBWrapper::CLevelDBWrapper(const boost::filesystem::path& path, size_t nCa
7676
bool key_exists = Read(OBFUSCATE_KEY_KEY, obfuscate_key);
7777

7878
if (!key_exists && obfuscate && IsEmpty()) {
79-
// Initialize non-degenerate obfuscation if it won't upset
79+
// Initialize non-degenerate obfuscation if it won't upset
8080
// existing, non-obfuscated data.
8181
std::vector<unsigned char> new_key = CreateObfuscateKey();
8282

@@ -118,10 +118,10 @@ const std::string CLevelDBWrapper::OBFUSCATE_KEY_KEY("\000obfuscate_key", 14);
118118
const unsigned int CLevelDBWrapper::OBFUSCATE_KEY_NUM_BYTES = 8;
119119

120120
/**
121-
* Returns a string (consisting of 8 random bytes) suitable for use as an
122-
* obfuscating XOR key.
121+
* Returns a string (consisting of 8 random bytes) suitable for use as an
122+
* obfuscating XOR key.
123123
*/
124-
std::vector<unsigned char> CLevelDBWrapper::CreateObfuscateKey() const
124+
std::vector<unsigned char> CLevelDBWrapper::CreateObfuscateKey() const
125125
{
126126
unsigned char buff[OBFUSCATE_KEY_NUM_BYTES];
127127
GetRandBytes(buff, OBFUSCATE_KEY_NUM_BYTES);
@@ -136,19 +136,17 @@ bool CLevelDBWrapper::IsEmpty()
136136
return !(it->Valid());
137137
}
138138

139-
const std::vector<unsigned char>& CLevelDBWrapper::GetObfuscateKey() const
140-
{
141-
return obfuscate_key;
139+
const std::vector<unsigned char>& CLevelDBWrapper::GetObfuscateKey() const
140+
{
141+
return obfuscate_key;
142142
}
143143

144144
std::string CLevelDBWrapper::GetObfuscateKeyHex() const
145-
{
146-
return HexStr(obfuscate_key);
145+
{
146+
return HexStr(obfuscate_key);
147147
}
148148

149149
CLevelDBIterator::~CLevelDBIterator() { delete piter; }
150150
bool CLevelDBIterator::Valid() { return piter->Valid(); }
151151
void CLevelDBIterator::SeekToFirst() { piter->SeekToFirst(); }
152-
void CLevelDBIterator::SeekToLast() { piter->SeekToLast(); }
153152
void CLevelDBIterator::Next() { piter->Next(); }
154-
void CLevelDBIterator::Prev() { piter->Prev(); }

src/leveldbwrapper.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class CLevelDBBatch
6868
batch.Delete(slKey);
6969
}
7070
};
71-
71+
7272
class CLevelDBIterator
7373
{
7474
private:
@@ -88,7 +88,6 @@ class CLevelDBIterator
8888
bool Valid();
8989

9090
void SeekToFirst();
91-
void SeekToLast();
9291

9392
template<typename K> void Seek(const K& key) {
9493
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
@@ -99,7 +98,6 @@ class CLevelDBIterator
9998
}
10099

101100
void Next();
102-
void Prev();
103101

104102
template<typename K> bool GetKey(K& key) {
105103
leveldb::Slice slKey = piter->key();
@@ -133,7 +131,7 @@ class CLevelDBIterator
133131
}
134132

135133
};
136-
134+
137135
class CLevelDBWrapper
138136
{
139137
private:
@@ -163,10 +161,10 @@ class CLevelDBWrapper
163161

164162
//! the key under which the obfuscation key is stored
165163
static const std::string OBFUSCATE_KEY_KEY;
166-
164+
167165
//! the length of the obfuscate key in number of bytes
168166
static const unsigned int OBFUSCATE_KEY_NUM_BYTES;
169-
167+
170168
std::vector<unsigned char> CreateObfuscateKey() const;
171169

172170
public:
@@ -256,7 +254,7 @@ class CLevelDBWrapper
256254
return WriteBatch(batch, true);
257255
}
258256

259-
CLevelDBIterator *NewIterator()
257+
CLevelDBIterator *NewIterator()
260258
{
261259
return new CLevelDBIterator(pdb->NewIterator(iteroptions), &obfuscate_key);
262260
}

0 commit comments

Comments
 (0)