I am trying to rebase an old codebase to the latest BTC (.10) with headers first sync.
I am getting the correct block hashes in order from peers, but when it calls ReadCompactSize() it throws 'size too large' error.
{
std::vector
// Bypass the normal CBlock deserialization, as we don't want to risk deserializing 2000 full blocks.
unsigned int nCount = ReadCompactSize(vRecv);
if (nCount > MAX_HEADERS_RESULTS) {
Misbehaving(pfrom->GetId(), 20);
return error("headers message size = %u", nCount);
}
headers.resize(nCount);
for (unsigned int n = 0; n < nCount; n++) {
vRecv >> headers[n];
ReadCompactSize(vRecv); // ignore tx count; assume it is 0.
}
If I comment out
throw std::ios_base::failure("ReadCompactSize(): size too large");