diff options
author | MacroFake <falke.marco@gmail.com> | 2022-06-24 08:09:39 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-06-24 08:09:50 +0200 |
commit | f697c068ebd0dfea552c1ff192dfd9d520f1ca9a (patch) | |
tree | e8ae9fd40bcf14a26726748e5258a1350103a5d0 | |
parent | 2598720d6c1ef15288045599de7e65f8707d09bc (diff) | |
parent | e4b4db561049c97c956e5b856713dcf63ac3e2f0 (diff) |
Merge bitcoin/bitcoin#25438: refactor: remove unused methods in classes `CDBIterator,CDBWrapper,CCoinsViewDBCursor`
e4b4db561049c97c956e5b856713dcf63ac3e2f0 refactor: remove unused method `CDBWrapper::CompactRange` (Sebastian Falbesoner)
fb38c6e21f064e23b63a46d15adb873029463cff refactor: remove unused methods `{CDBIterator,CCoinsViewDBCursor}::GetValueSize()` (Sebastian Falbesoner)
Pull request description:
The `GetValueSize` methods haven't been used since the chainstate db cache has been switched from per-tx to per-txout model years ago (PR #10195, commit d342424301013ec47dc146a4beb49d5c9319d80a). The `CompactRange` is unused since the txindex migration code was removed (PR https://github.com/bitcoin/bitcoin/pull/22626, commit https://github.com/bitcoin/bitcoin/commit/fa20f815a9cb438c5ab61e97a453612ddd8b21b5).
ACKs for top commit:
fanquake:
ACK e4b4db561049c97c956e5b856713dcf63ac3e2f0
furszy:
re-ACK e4b4db56
laanwj:
Code review ACK e4b4db561049c97c956e5b856713dcf63ac3e2f0
Tree-SHA512: 77da445fb70c744046263c6f2ddb05782b68e3d4b2ea604dd7c7dc73ce7c1f2d2b48ec68db4dcb03e35fc27488b99b0a420f6fa3d5b83d325c1708ed68e99e0a
-rw-r--r-- | src/coins.h | 1 | ||||
-rw-r--r-- | src/dbwrapper.h | 21 | ||||
-rw-r--r-- | src/txdb.cpp | 6 |
3 files changed, 0 insertions, 28 deletions
diff --git a/src/coins.h b/src/coins.h index de297dd427..67fecc9785 100644 --- a/src/coins.h +++ b/src/coins.h @@ -142,7 +142,6 @@ public: virtual bool GetKey(COutPoint &key) const = 0; virtual bool GetValue(Coin &coin) const = 0; - virtual unsigned int GetValueSize() const = 0; virtual bool Valid() const = 0; virtual void Next() = 0; diff --git a/src/dbwrapper.h b/src/dbwrapper.h index 1109cb5888..cef8426d61 100644 --- a/src/dbwrapper.h +++ b/src/dbwrapper.h @@ -166,11 +166,6 @@ public: } return true; } - - unsigned int GetValueSize() { - return piter->value().size(); - } - }; class CDBWrapper @@ -318,22 +313,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 diff --git a/src/txdb.cpp b/src/txdb.cpp index a0939873ad..c048c2d92a 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -211,7 +211,6 @@ public: bool GetKey(COutPoint &key) const override; bool GetValue(Coin &coin) const override; - unsigned int GetValueSize() const override; bool Valid() const override; void Next() override; @@ -257,11 +256,6 @@ bool CCoinsViewDBCursor::GetValue(Coin &coin) const return pcursor->GetValue(coin); } -unsigned int CCoinsViewDBCursor::GetValueSize() const -{ - return pcursor->GetValueSize(); -} - bool CCoinsViewDBCursor::Valid() const { return keyTmp.first == DB_COIN; |