while(bsb.streamPull())
{
while(bsb.reader().getSizeRemaining() > 8)
{
...
BinaryRefReader brr(bsb.reader().getCurrPtr(), nextBlkSize);
parseNewBlockData(brr, fnum-1, bsb.getFileByteLocation(), nextBlkSize);
blocksReadSoFar_++;
bytesReadSoFar_ += nextBlkSize;
bsb.reader().advance(nextBlkSize);
}
}
I made this small change and it drastically reduces the output, my freshly imported wallet still shows the right balance, but I'm sure it's not a real fix, since it looks like there's a bunch of data left unread...
if(!parseNewBlockData(brr, fnum-1, bsb.getFileByteLocation(), nextBlkSize))
{
cout << "Next block size: " << nextBlkSize << endl;
cout << "Buffer size remaining: " << bsb.reader().getSizeRemaining() << endl;
cout << "Reader size remaining: " << brr.getSizeRemaining() << endl;
break;
}
And here's some sample output with that change:
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 2231
Reader size remaining: 0
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 3349
Reader size remaining: 0
Attempting to read blockchain from file: /home/bitcoin/.bitcoin/blocks/blk00001.dat
/home/bitcoin/.bitcoin/blocks/blk00001.dat is 128 MB
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 9362
Reader size remaining: 0
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 20808
Reader size remaining: 0
Attempting to read blockchain from file: /home/bitcoin/.bitcoin/blocks/blk00002.dat
/home/bitcoin/.bitcoin/blocks/blk00002.dat is 128 MB
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 16391
Reader size remaining: 0
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 28286
Reader size remaining: 0
Attempting to read blockchain from file: /home/bitcoin/.bitcoin/blocks/blk00003.dat
/home/bitcoin/.bitcoin/blocks/blk00003.dat is 128 MB
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 25310
Reader size remaining: 0
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 25309
Reader size remaining: 0
Attempting to read blockchain from file: /home/bitcoin/.bitcoin/blocks/blk00004.dat
/home/bitcoin/.bitcoin/blocks/blk00004.dat is 128 MB
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 3530
Reader size remaining: 0
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 6970
Reader size remaining: 0
Attempting to read blockchain from file: /home/bitcoin/.bitcoin/blocks/blk00005.dat
/home/bitcoin/.bitcoin/blocks/blk00005.dat is 128 MB
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 15835
Reader size remaining: 0
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 24656
Reader size remaining: 0
Attempting to read blockchain from file: /home/bitcoin/.bitcoin/blocks/blk00006.dat
/home/bitcoin/.bitcoin/blocks/blk00006.dat is 128 MB
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 27895
Reader size remaining: 0
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 29726
Reader size remaining: 0
Attempting to read blockchain from file: /home/bitcoin/.bitcoin/blocks/blk00007.dat
/home/bitcoin/.bitcoin/blocks/blk00007.dat is 128 MB
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 14370
Reader size remaining: 0
***ERROR: parseNewBlockData did not get enough data...
***ERROR: parseNewBlockData did not get enough data...
Next block size: 0
Buffer size remaining: 41116
Reader size remaining: 0