Add MESSAGE_START_SIZE from chainparams when loading blocks from external files.

This commit is contained in:
Simon de la Rouviere 2014-04-24 14:32:11 +02:00 committed by langerhans
parent 5b910bbfe5
commit 6cfb6d6033

View file

@ -3200,11 +3200,11 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
unsigned int nSize = 0;
try {
// locate a header
unsigned char buf[4];
unsigned char buf[MESSAGE_START_SIZE];
blkdat.FindByte(Params().MessageStart()[0]);
nRewind = blkdat.GetPos()+1;
blkdat >> FLATDATA(buf);
if (memcmp(buf, Params().MessageStart(), 4))
if (memcmp(buf, Params().MessageStart(), MESSAGE_START_SIZE))
continue;
// read size
blkdat >> nSize;