OSDN Git Service

Bug fix: CDataStream::GetAndClear() when nReadPos > 0
authormonacoinproject <monacoinproject@gmail.com>
Sun, 6 Apr 2014 14:01:26 +0000 (23:01 +0900)
committermonacoinproject <monacoinproject@gmail.com>
Sun, 6 Apr 2014 14:01:26 +0000 (23:01 +0900)
commit2e6151ce5593d1be83555c100ea94d068e351d42
treeee96ac461e54f197e7b95787747fdb2db3c8b594
parentd0b5fe70561c1f34d1060c1ab53ed32bc2c74e2b
Bug fix: CDataStream::GetAndClear() when nReadPos > 0

Changed CDataStream::GetAndClear() to use the most obvious
get get and clear instead of a tricky swap().

Added a unit test for CDataStream insert/erase/GetAndClear.

Note: GetAndClear() is not performance critical, it is used only
by the send-a-message-to-the-network code. Bug was not noticed
before now because the send-a-message code never erased from the
stream.
src/serialize.h
src/test/serialize_tests.cpp