mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-13 00:28:03 +00:00
Fixed functional test cnHeader merkle root.
This commit is contained in:
parent
3007571789
commit
991678d552
@ -176,6 +176,8 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
|
|||||||
UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);
|
UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);
|
||||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, chainparams.GetConsensus());
|
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, chainparams.GetConsensus());
|
||||||
pblock->nNonce = nHeight; // nNonce now holds the height for Cryptonight variant 4
|
pblock->nNonce = nHeight; // nNonce now holds the height for Cryptonight variant 4
|
||||||
|
pblock->cnHeader.major_version = Params().GetConsensus().GetCryptonoteMajorVersion();
|
||||||
|
pblock->cnHeader.prev_id = pblock->GetOriginalBlockHash();
|
||||||
pblocktemplate->vTxSigOpsCost[0] = WITNESS_SCALE_FACTOR * GetLegacySigOpCount(*pblock->vtx[0]);
|
pblocktemplate->vTxSigOpsCost[0] = WITNESS_SCALE_FACTOR * GetLegacySigOpCount(*pblock->vtx[0]);
|
||||||
|
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
|
@ -42,7 +42,8 @@ def create_block(hashprev, coinbase, nTime=None):
|
|||||||
assert block.nNonce > 0
|
assert block.nNonce > 0
|
||||||
block.major_version = 10 # CN variant 4
|
block.major_version = 10 # CN variant 4
|
||||||
block.timestamp = block.nTime
|
block.timestamp = block.nTime
|
||||||
|
# Give merkle root a random value.
|
||||||
|
block.merkle_root = uint256_from_str(bytes.fromhex("3cf6c3b6da3f4058853ee70369ee43d473aca91ae8fc8f44a645beb21c392d80"))
|
||||||
block.calc_sha256()
|
block.calc_sha256()
|
||||||
return block
|
return block
|
||||||
|
|
||||||
|
@ -630,9 +630,6 @@ class CBlockHeader():
|
|||||||
|
|
||||||
c += ser_uint256(self.prev_id)
|
c += ser_uint256(self.prev_id)
|
||||||
c += struct.pack("<I", self.nonce)
|
c += struct.pack("<I", self.nonce)
|
||||||
|
|
||||||
# hardcoded merkle root.
|
|
||||||
self.merkle_root = uint256_from_str(bytes.fromhex("3cf6c3b6da3f4058853ee70369ee43d473aca91ae8fc8f44a645beb21c392d80"))
|
|
||||||
c += ser_uint256(self.merkle_root)
|
c += ser_uint256(self.merkle_root)
|
||||||
c += struct.pack("<B", self.nTxes)
|
c += struct.pack("<B", self.nTxes)
|
||||||
# self.sha256 stores the cn_fast hash.
|
# self.sha256 stores the cn_fast hash.
|
||||||
|
Loading…
Reference in New Issue
Block a user