Bitcoin Institute

Satoshi to Hal Finney: A serialize.h code change (January 24, 2009)

Satoshi Nakamoto January 25, 2009 00:47 UTC

I hate duplicating code, but the compiler forces us. Copy the body of the function above it, like this:

  void insert(iterator it, const_iterator first, 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)
   {
     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);
   }
#endif

The modified version of serialize.h is attached.

BTW, in my tests, VC8 produced an EXE that would only run on systems that had VC8 installed on them. The error it gives is extremely vague. I think they expect you to install a package during setup, but bitcoin doesn’t have a setup.

My testing has been with MSVC 6.0 SP6 and GCC 3.4.5. GCC is the release build. There’s nothing wrong with the MSVC 6.0 build other than its optimization of the SHA routines for generating blocks is slow.

Satoshi

Original external source

https://online.wsj.com/public/resources/documents/finneynakamotoemails.pdf
Transcribed from the Wall Street Journal PDF. Hal Finney supplied the emails to the Journal in spring 2014. Subject: "Re: disk full". PDF header: Sat, Jan 24, 2009 at 4:47 PM; no time zone is given, so the time is converted to UTC assuming Pacific Standard Time (UTC−8). Visual line wraps have been rejoined. Attachments mentioned in the email are not preserved.

Other external sources