Merge branch '0.5.x' into 0.6.0.x
authorLuke Dashjr <luke-jr+git@utopios.org>
Tue, 22 May 2012 22:57:10 +0000 (22:57 +0000)
committerLuke Dashjr <luke-jr+git@utopios.org>
Tue, 22 May 2012 22:57:10 +0000 (22:57 +0000)
Conflicts:
src/main.cpp

1  2 
src/db.cpp
src/db.h
src/main.cpp
src/main.h

diff --cc src/db.cpp
Simple merge
diff --cc src/db.h
Simple merge
diff --cc src/main.cpp
@@@ -2401,11 -2220,13 +2401,13 @@@ bool static ProcessMessage(CNode* pfrom
          // find last block in inv vector
          unsigned int nLastBlock = (unsigned int)(-1);
          for (unsigned int nInv = 0; nInv < vInv.size(); nInv++) {
-             if (vInv[vInv.size() - 1 - nInv].type == MSG_BLOCK)
+             if (vInv[vInv.size() - 1 - nInv].type == MSG_BLOCK) {
                  nLastBlock = vInv.size() - 1 - nInv;
+                 break;
+             }
          }
          CTxDB txdb("r");
 -        for (int nInv = 0; nInv < vInv.size(); nInv++)
 +        for (unsigned int nInv = 0; nInv < vInv.size(); nInv++)
          {
              const CInv &inv = vInv[nInv];
  
@@@ -2796,14 -2632,17 +2798,14 @@@ bool ProcessMessages(CNode* pfrom
          }
  
          // Checksum
 -        if (vRecv.GetVersion() >= 209)
 +        uint256 hash = Hash(vRecv.begin(), vRecv.begin() + nMessageSize);
 +        unsigned int nChecksum = 0;
 +        memcpy(&nChecksum, &hash, sizeof(nChecksum));
 +        if (nChecksum != hdr.nChecksum)
          {
-             printf("ProcessMessage(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n",
 -            uint256 hash = Hash(vRecv.begin(), vRecv.begin() + nMessageSize);
 -            unsigned int nChecksum = 0;
 -            memcpy(&nChecksum, &hash, sizeof(nChecksum));
 -            if (nChecksum != hdr.nChecksum)
 -            {
 -                printf("ProcessMessages(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n",
 -                       strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum);
 -                continue;
 -            }
++            printf("ProcessMessages(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n",
 +               strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum);
 +            continue;
          }
  
          // Copy message to its own buffer
diff --cc src/main.h
Simple merge