From: Luke Dashjr Date: Tue, 22 May 2012 22:57:10 +0000 (+0000) Subject: Merge branch '0.5.x' into 0.6.0.x X-Git-Tag: v0.4.0-unstable~129^2~1^2^2~2 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=d67b0434f24a629372000b0bd573ea9013ca3d90 Merge branch '0.5.x' into 0.6.0.x Conflicts: src/main.cpp --- d67b0434f24a629372000b0bd573ea9013ca3d90 diff --cc src/main.cpp index ad75892,792bbe9..7ffecaf --- a/src/main.cpp +++ b/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