Commit Graph

7 Commits

Author SHA1 Message Date
Pieter Wuille
87a5975ca0 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.
2018-04-17 13:09:48 +01:00
Jack Grigg
a8e5ae92ba GetSerializeSize changes in Zcash-specific code 2018-04-16 07:38:38 -06:00
Pieter Wuille
b8a6579366 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.
2018-04-16 07:38:38 -06:00
Pavel Janík
56aa25684c Do not shadow members in dbwrapper 2018-04-03 20:40:54 +01:00
Wladimir J. van der Laan
3923bcca7c dbwrapper: Move HandleError to dbwrapper_private
HandleError is implementation-specific.
2018-04-03 20:40:54 +01:00
Wladimir J. van der Laan
809a429ecf dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIterator
Zcash: Makes future extensions easier.

Original description (when this was introduced upstream):

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.
2018-04-03 20:40:54 +01:00
Jeff Garzik
e3da7a572d leveldbwrapper file rename to dbwrapper.* 2018-04-03 20:40:54 +01:00