aboutsummaryrefslogtreecommitdiff
path: root/src/streams.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix some empty vector referencesPieter Wuille2017-06-051-2/+6
| | | | | | | | streams.h has some methods that can be tricked into dereferencing null pointers or end() iterators. Fix this. Github-Pull: #10250 Rebased-From: f478d98fe49d3c0c0f2c79b3f8d9dbfc1aafd407
* Merge #9353: Add data() method to CDataStream (and use it)Pieter Wuille2017-01-091-4/+2
|\ | | | | | | | | | | | | | | 5113474 wallet: Use CDataStream.data() (Wladimir J. van der Laan) e2300ff bench: Use CDataStream.data() (Wladimir J. van der Laan) adff950 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan) a2141e4 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan) af4c44c streams: Add data() method to CDataStream (Wladimir J. van der Laan)
| * streams: Remove special cases for ancient MSVCWladimir J. van der Laan2016-12-151-4/+0
| | | | | | | | | | Quite sure that we haven't supported MSVC 6.0 for ages (MSC_VER 1300 is >= MSVC++ 7.0) but with the C++11 switch we can be sure.
| * streams: Add data() method to CDataStreamWladimir J. van der Laan2016-12-151-0/+2
| | | | | | | | Analogous to c++11 vector data().
* | Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
|/ | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* net: add CVectorWriter and CNetMsgMakerCory Fields2016-11-251-0/+69
| | | | | | | CVectorWriter is useful for overwriting or appending an existing byte vector. CNetMsgMaker is a shortcut for creating messages on-the-fly which are suitable for pushing to CConnman.
* Get rid of nType and nVersionPieter Wuille2016-11-071-9/+25
| | | | | | | | | | | Remove the nType and nVersion as parameters to all serialization methods and functions. There is only one place where it's read and has an impact (in CAddress), and even there it does not impact any of the recursively invoked serializers. Instead, the few places that need nType or nVersion are changed to read it directly from the stream object, through GetType() and GetVersion() methods which are added to all stream classes.
* Make GetSerializeSize a wrapper on top of CSizeComputerPieter Wuille2016-11-071-14/+0
| | | | | | | | | | | 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.
* Make nType and nVersion private and sometimes constPieter Wuille2016-11-071-19/+15
| | | | | Make the various stream implementations' nType and nVersion private and const (except in CDataStream where we really need a setter).
* Make streams' read and write return voidPieter Wuille2016-11-071-16/+9
| | | | | | | | The stream implementations had two cascading layers (the upper one with operator<< and operator>>, and a lower one with read and write). The lower layer's functions are never cascaded (nor should they, as they should only be used from the higher layer), so make them return void instead.
* Remove unused ReadVersion and WriteVersionPieter Wuille2016-11-071-4/+0
| | | | | CDataStream and CAutoFile had a ReadVersion and WriteVersion method that was never used. Remove them.
* serialization: teach serializers variadicsCory Fields2016-11-031-0/+7
| | | | Also add a variadic CDataStream ctor for ease-of-use.
* BIP144: Serialization, hashes, relay (sender side)Pieter Wuille2016-06-221-0/+33
| | | | | | Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
* Fix OOM bug: UTXO entries with invalid script lengthPieter Wuille2016-04-251-0/+14
|
* CDataStream::ignore Throw exception instead of assert on negative nSize.Patrick Strateman2016-04-251-1/+3
| | | | Previously disk corruption would cause an assert instead of an exception.
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* Add chainstate obfuscation to avoid spurious antivirus detectionJames O'Beirne2015-10-061-0/+23
| | | | | | | | Adds an `obfuscate` parameter to `CLevelDBWrapper` and makes use of it for all new chainstate stores built via `CCoinsViewDB`. Also adds an `Xor` method to `CDataStream`. Thanks to @sipa @laanwj @pstratem @dexX7 @KyrosKrane @gmaxwell.
* allocators: split allocators and pagelockerCory Fields2015-03-201-1/+1
| | | | | Pagelocker is only needed for secure (usually wallet) operations, so don't make the zero-after-free allocator depend on it.
* openssl: abstract out OPENSSL_cleanseCory Fields2015-02-151-0/+1
| | | | | | This makes it easier for us to replace it if desired, since it's now only in one spot. Also, it avoids the openssl include from allocators.h, which essentially forced openssl to be included from every compilation unit.
* Remove whitespaces before double colon in errors and logsPavel Janík2015-01-311-9/+9
|
* Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* Remove references to X11 licenceMichael Ford2014-12-161-1/+1
|
* boost: split stream classes out of serialize.hCory Fields2014-10-221-0/+571
serialization now has no dependencies.