aboutsummaryrefslogtreecommitdiff
path: root/serialize.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-05-26 00:05:26 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-05-26 00:05:26 +0000
commit7a47324c7846ab0e500b974cd1f40e4030a7c0d2 (patch)
tree4b2b30223b78d51882769886945c63f5427a812b /serialize.h
parent9c1e9f0b6a1d073a5f450c847850ef1d8df74137 (diff)
downloadbitcoin-7a47324c7846ab0e500b974cd1f40e4030a7c0d2.tar.xz
better prevention of inventory relaying during initial download,
message checksum between nodes with 0.2.9 or higher, optimization level up from -O0 to -O2, rpc functions: setlabel, getlabel, getaddressesbylabel, getreceivedbyaddress, getreceivedbylabel, listreceivedbyaddress, listreceivedbylabel -- version 0.2.9
Diffstat (limited to 'serialize.h')
-rw-r--r--serialize.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/serialize.h b/serialize.h
index c47dddc87c..2292651e83 100644
--- a/serialize.h
+++ b/serialize.h
@@ -19,7 +19,7 @@ class CScript;
class CDataStream;
class CAutoFile;
-static const int VERSION = 208;
+static const int VERSION = 209;
static const char* pszSubVer = ".0";
@@ -809,6 +809,18 @@ public:
vch.insert(it, first, last);
}
+ void insert(iterator it, vector<char>::const_iterator first, vector<char>::const_iterator last)
+ {
+ if (it == vch.begin() + nReadPos && last - first <= nReadPos)
+ {
+ // special case for inserting at the front when there's room
+ nReadPos -= (last - first);
+ memcpy(&vch[nReadPos], &first[0], last - first);
+ }
+ else
+ vch.insert(it, first, last);
+ }
+
#if !defined(_MSC_VER) || _MSC_VER >= 1300
void insert(iterator it, const char* first, const char* last)
{