Skip to content

Commit

Permalink
Put back the line of code that writes block data to disk.
Browse files Browse the repository at this point in the history
Without this line blocks are not written to the data file.
The block index is still written. When it is read back the client
will crash because it cannot read the corresponding data.

Anyone who ran the buggy code without this fix and received a
block from a peer will need to redownload the blockchain.
  • Loading branch information
ali1234 committed Apr 29, 2012
1 parent 224392b commit dda31c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ class CBlock
long fileOutPos = ftell(fileout);
if (fileOutPos < 0)
return error("CBlock::WriteToDisk() : ftell failed");
fileout << *this;
nBlockPosRet = fileOutPos;

// Flush stdio buffers and commit to disk before returning
Expand Down

0 comments on commit dda31c7

Please sign in to comment.