Skip to content

Commit 0caf2b1

Browse files
committed
Add MESSAGE_START_SIZE from chainparams when loading blocks from external files.
1 parent 89bbd54 commit 0caf2b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,11 +3092,11 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
30923092
unsigned int nSize = 0;
30933093
try {
30943094
// locate a header
3095-
unsigned char buf[4];
3095+
unsigned char buf[MESSAGE_START_SIZE];
30963096
blkdat.FindByte(Params().MessageStart()[0]);
30973097
nRewind = blkdat.GetPos()+1;
30983098
blkdat >> FLATDATA(buf);
3099-
if (memcmp(buf, Params().MessageStart(), 4))
3099+
if (memcmp(buf, Params().MessageStart(), MESSAGE_START_SIZE))
31003100
continue;
31013101
// read size
31023102
blkdat >> nSize;

0 commit comments

Comments
 (0)