mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
Merge pull request #4087
0caf2b1
Add MESSAGE_START_SIZE from chainparams when loading blocks from external files. (Simon de la Rouviere)
This commit is contained in:
commit
4765b8c116
@ -3092,11 +3092,11 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
|
|||||||
unsigned int nSize = 0;
|
unsigned int nSize = 0;
|
||||||
try {
|
try {
|
||||||
// locate a header
|
// locate a header
|
||||||
unsigned char buf[4];
|
unsigned char buf[MESSAGE_START_SIZE];
|
||||||
blkdat.FindByte(Params().MessageStart()[0]);
|
blkdat.FindByte(Params().MessageStart()[0]);
|
||||||
nRewind = blkdat.GetPos()+1;
|
nRewind = blkdat.GetPos()+1;
|
||||||
blkdat >> FLATDATA(buf);
|
blkdat >> FLATDATA(buf);
|
||||||
if (memcmp(buf, Params().MessageStart(), 4))
|
if (memcmp(buf, Params().MessageStart(), MESSAGE_START_SIZE))
|
||||||
continue;
|
continue;
|
||||||
// read size
|
// read size
|
||||||
blkdat >> nSize;
|
blkdat >> nSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user