From 0caf2b187fb8831d622f601824eef8351faf1ce1 Mon Sep 17 00:00:00 2001 From: Simon de la Rouviere Date: Thu, 24 Apr 2014 14:32:11 +0200 Subject: [PATCH] Add MESSAGE_START_SIZE from chainparams when loading blocks from external files. --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a591168c07b..7a6d4b39de2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3092,11 +3092,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;