Commit graph

10 commits

Author SHA1 Message Date
Pieter Wuille d59a518466 Use fixed preallocation instead of costly GetSerializeSize
Dbwrapper used GetSerializeSize() to compute the size of the buffer
to preallocate. For some cases (specifically: CCoins) this requires
a costly compression call. Avoid this by just using fixed size
preallocations instead.
2016-11-07 13:56:27 -08:00
Pieter Wuille 657e05ab2e Make GetSerializeSize a wrapper on top of CSizeComputer
Given that in default GetSerializeSize implementations created by
ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid
of the specialized GetSerializeSize methods everywhere, and just use
CSizeComputer. This removes a lot of code which isn't actually used
anywhere.

For CCompactSize and CVarInt this actually removes a more efficient
size computing algorithm, which is brought back in a later commit.
2016-11-07 13:56:22 -08:00
Pavel Janík 4a35e0f34c Do not shadow members in dbwrapper 2016-08-05 21:17:50 +02:00
Wladimir J. van der Laan 869cf1234a dbwrapper: Move HandleError to dbwrapper_private
HandleError is implementation-specific.
2016-04-23 09:32:25 +02:00
Wladimir J. van der Laan b69836d6ff dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIterator
Pass parent wrapper directly instead of obfuscation key. This
makes it possible for other databases which re-use this code
to use other properties from the database.

Add a namespace dbwrapper_private for private functions to be used
only in dbwrapper.h/cpp and dbwrapper_tests.
2016-04-23 09:32:25 +02:00
Wladimir J. van der Laan 878bf480a3 dbwrapper: Remove CDBWrapper::GetObfuscateKeyHex
It is an unnecessary method as it is used only two times
and only internally, and the whole implementation is
HexStr(obfuscate_key).
2016-04-23 09:32:25 +02:00
Wladimir J. van der Laan 74f7b1273c dbwrapper: Remove throw keywords in function signatures
Using throw() specifications in function signatures is not only
not required in C++, it is considered deprecated for
[various reasons](https://stackoverflow.com/questions/1055387/throw-keyword-in-functions-signature).
It is not implemented by any of the common C++ compilers. The usage is
also inconsistent with the rest of the source code.
2016-04-23 09:32:25 +02:00
MarcoFalke fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
Philip Kaufmann ad5aae15b4 constify missing catch cases
- ensure all missing catch cases are constant where possible
2015-10-27 17:39:42 +01:00
Jeff Garzik 3795e8152b leveldbwrapper file rename to dbwrapper.* 2015-10-22 21:33:06 -04:00
Renamed from src/leveldbwrapper.h (Browse further)