HomePhabricator

Bug fix: CDataStream::GetAndClear() when nReadPos > 0
d5d1425657d0Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

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.

Details

Provenance
Gavin Andresen <gavinandresen@gmail.com>Authored on Oct 29 2013, 01:16
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGINGcd1fc2434ce8: Merge pull request #3164 from TheBlueMatt/master
Branches
Unknown
Tags
Unknown

Event Timeline

Gavin Andresen <gavinandresen@gmail.com> committed rSTAGINGd5d1425657d0: Bug fix: CDataStream::GetAndClear() when nReadPos > 0 (authored by Gavin Andresen <gavinandresen@gmail.com>).Oct 29 2013, 01:20