Browse Source

magic number for hard fork 1

pull/26/head
orignal 7 years ago
parent
commit
fad50ba603
  1. 18
      src/main.cpp
  2. 2
      src/main.h

18
src/main.cpp

@ -2845,10 +2845,16 @@ bool LoadBlockIndex() @@ -2845,10 +2845,16 @@ bool LoadBlockIndex()
{
if (fTestNet)
{
pchMessageStart[0] = 0xfa;
pchMessageStart[1] = 0xc4;
pchMessageStart[2] = 0xa7;
pchMessageStart[3] = 0x4b;
pchMessageStart[0] = 0xfa;
pchMessageStart[1] = 0xc4;
pchMessageStart[2] = 0xa7;
pchMessageStart[3] = 0x4b;
pchMessageStartHF1[0] = 0x90;
pchMessageStartHF1[1] = 0x57;
pchMessageStartHF1[2] = 0x73;
pchMessageStartHF1[3] = 0x57;
hashGenesisBlock = uint256("0x0000051862557b7ed888cde9cfb580eddd592f6e34b4bbe3612f3734ecf8bdb3");
}
@ -3208,7 +3214,7 @@ bool static AlreadyHave(const CInv& inv) @@ -3208,7 +3214,7 @@ bool static AlreadyHave(const CInv& inv)
// The characters are rarely used upper ASCII, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
unsigned char pchMessageStart[4] = { 0xfa, 0xca, 0xba, 0xda };
unsigned char pchMessageStartHF1[4] = { 0x90, 0x57, 0x53, 0xc7 };
void static ProcessGetData(CNode* pfrom)
{
@ -3992,7 +3998,7 @@ bool ProcessMessages(CNode* pfrom) @@ -3992,7 +3998,7 @@ bool ProcessMessages(CNode* pfrom)
it++;
// Scan for message start
if (memcmp(msg.hdr.pchMessageStart, pchMessageStart, sizeof(pchMessageStart)) != 0) {
if (memcmp(msg.hdr.pchMessageStart, pchMessageStart, 4) != 0) {
printf("\n\nPROCESSMESSAGE: INVALID MESSAGESTART\n\n");
fOk = false;
break;

2
src/main.h

@ -88,7 +88,7 @@ extern int64 nHPSTimerStart; @@ -88,7 +88,7 @@ extern int64 nHPSTimerStart;
extern int64 nTimeBestReceived;
extern CCriticalSection cs_setpwalletRegistered;
extern std::set<CWallet*> setpwalletRegistered;
extern unsigned char pchMessageStart[4];
extern unsigned char pchMessageStart[4], pchMessageStartHF1[4];
extern bool fImporting;
extern bool fReindex;
extern bool fBenchmark;

Loading…
Cancel
Save