checking properly typed header transfer
This commit is contained in:
@@ -6016,7 +6016,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end
|
// we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end
|
||||||
vector<CBlock> vHeaders;
|
vector<CBlockHeader> vHeaders;
|
||||||
int nLimit = MAX_HEADERS_RESULTS;
|
int nLimit = MAX_HEADERS_RESULTS;
|
||||||
LogPrint("net", "getheaders %d to %s from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString(), pfrom->id);
|
LogPrint("net", "getheaders %d to %s from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString(), pfrom->id);
|
||||||
//if ( pfrom->lasthdrsreq >= chainActive.Height()-MAX_HEADERS_RESULTS || pfrom->lasthdrsreq != (int32_t)(pindex ? pindex->nHeight : -1) )// no need to ever suppress this
|
//if ( pfrom->lasthdrsreq >= chainActive.Height()-MAX_HEADERS_RESULTS || pfrom->lasthdrsreq != (int32_t)(pindex ? pindex->nHeight : -1) )// no need to ever suppress this
|
||||||
@@ -6027,7 +6027,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
CBlockHeader h = pindex->GetBlockHeader();
|
CBlockHeader h = pindex->GetBlockHeader();
|
||||||
printf("size.%i, solution size.%i\n", (int)sizeof(h), (int)h.nSolution.size());
|
printf("size.%i, solution size.%i\n", (int)sizeof(h), (int)h.nSolution.size());
|
||||||
printf("hash.%s prevhash.%s nonce.%s\n", h.GetHash().ToString().c_str(), h.hashPrevBlock.ToString().c_str(), h.nNonce.ToString().c_str());
|
printf("hash.%s prevhash.%s nonce.%s\n", h.GetHash().ToString().c_str(), h.hashPrevBlock.ToString().c_str(), h.nNonce.ToString().c_str());
|
||||||
vHeaders.push_back(CBlock(pindex->GetBlockHeader()));
|
vHeaders.push_back(pindex->GetBlockHeader());
|
||||||
if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop)
|
if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -6185,7 +6185,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
headers.resize(nCount);
|
headers.resize(nCount);
|
||||||
for (unsigned int n = 0; n < nCount; n++) {
|
for (unsigned int n = 0; n < nCount; n++) {
|
||||||
vRecv >> headers[n];
|
vRecv >> headers[n];
|
||||||
ReadCompactSize(vRecv); // ignore tx count; assume it is 0.
|
//ReadCompactSize(vRecv); // ignore tx count; assume it is 0.
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
@@ -6196,7 +6196,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CBlockIndex *pindexLast = NULL;
|
CBlockIndex *pindexLast = NULL;
|
||||||
BOOST_FOREACH(const CBlock& header, headers) {
|
BOOST_FOREACH(const CBlockHeader& header, headers) {
|
||||||
printf("size.%i, solution size.%i\n", (int)sizeof(header), (int)header.nSolution.size());
|
printf("size.%i, solution size.%i\n", (int)sizeof(header), (int)header.nSolution.size());
|
||||||
printf("hash.%s prevhash.%s nonce.%s\n", header.GetHash().ToString().c_str(), header.hashPrevBlock.ToString().c_str(), header.nNonce.ToString().c_str());
|
printf("hash.%s prevhash.%s nonce.%s\n", header.GetHash().ToString().c_str(), header.hashPrevBlock.ToString().c_str(), header.nNonce.ToString().c_str());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user