Browse Source

src/txmempool.cpp: make numEntries a uint32_t

Don't ever serialize a size_t or long, their sizes are platform
dependent.
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
9f4fac98c4
  1. 4
      src/txmempool.cpp

4
src/txmempool.cpp

@ -337,7 +337,7 @@ public: @@ -337,7 +337,7 @@ public:
void Write(CAutoFile& fileout) const
{
fileout << nBestSeenHeight;
fileout << history.size();
fileout << (uint32_t)history.size();
BOOST_FOREACH(const CBlockAverage& entry, history)
{
entry.Write(fileout);
@ -348,7 +348,7 @@ public: @@ -348,7 +348,7 @@ public:
{
int nFileBestSeenHeight;
filein >> nFileBestSeenHeight;
size_t numEntries;
uint32_t numEntries;
filein >> numEntries;
if (numEntries <= 0 || numEntries > 10000)
throw runtime_error("Corrupt estimates file. Must have between 1 and 10k entries.");

Loading…
Cancel
Save