mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-09-03 02:11:55 +00:00
Introduced block legacy mode for regtests.
This commit is contained in:
parent
937095dd4d
commit
1e55d22ac0
@ -148,7 +148,7 @@ public:
|
|||||||
READWRITE(nBits);
|
READWRITE(nBits);
|
||||||
READWRITE(nNonce);
|
READWRITE(nNonce);
|
||||||
// Genesis block does not have cnHeader.
|
// Genesis block does not have cnHeader.
|
||||||
if (!hashPrevBlock.IsNull()) {
|
if (!hashPrevBlock.IsNull() && !legacyMode) {
|
||||||
READWRITE(cnHeader);
|
READWRITE(cnHeader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -161,6 +161,7 @@ public:
|
|||||||
nTime = 0;
|
nTime = 0;
|
||||||
nBits = 0;
|
nBits = 0;
|
||||||
nNonce = 0;
|
nNonce = 0;
|
||||||
|
legacyMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsNull() const
|
bool IsNull() const
|
||||||
@ -178,6 +179,21 @@ public:
|
|||||||
{
|
{
|
||||||
return (int64_t)nTime;
|
return (int64_t)nTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetLegacy(bool legacy)
|
||||||
|
{
|
||||||
|
legacyMode = legacy;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isLegacy()
|
||||||
|
{
|
||||||
|
return legacyMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// When legacyMode is true, cnHeader is not used.
|
||||||
|
// This is used for regtest.
|
||||||
|
bool legacyMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -225,6 +241,7 @@ public:
|
|||||||
block.nTime = nTime;
|
block.nTime = nTime;
|
||||||
block.nBits = nBits;
|
block.nBits = nBits;
|
||||||
block.nNonce = nNonce;
|
block.nNonce = nNonce;
|
||||||
|
block.SetLegacy(legacyMode);
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user