MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CRegTestParams

Method CRegTestParams

src/kernel/chainparams.cpp:568–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566{
567public:
568 explicit CRegTestParams(const RegTestOptions& opts)
569 {
570 m_chain_type = ChainType::REGTEST;
571 consensus.signet_blocks = false;
572 consensus.signet_challenge.clear();
573 consensus.nSubsidyHalvingInterval = 150;
574 consensus.BIP34Height = 1; // Always active unless overridden
575 consensus.BIP34Hash = uint256();
576 consensus.BIP65Height = 1; // Always active unless overridden
577 consensus.BIP66Height = 1; // Always active unless overridden
578 consensus.CSVHeight = 1; // Always active unless overridden
579 consensus.SegwitHeight = 0; // Always active unless overridden
580 consensus.MinBIP9WarningHeight = 0;
581 consensus.powLimit = uint256{"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"};
582 consensus.nPowTargetTimespan = 24 * 60 * 60; // one day
583 consensus.nPowTargetSpacing = 10 * 60;
584 consensus.fPowAllowMinDifficultyBlocks = true;
585 consensus.enforce_BIP94 = opts.enforce_bip94;
586 consensus.fPowNoRetargeting = true;
587
588 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
589 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
590 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
591 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
592 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].threshold = 108; // 75%
593 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].period = 144; // Faster than normal for regtest (144 instead of 2016)
594
595 consensus.nMinimumChainWork = uint256{};
596 consensus.defaultAssumeValid = uint256{};
597
598 pchMessageStart[0] = 0xfa;
599 pchMessageStart[1] = 0xbf;
600 pchMessageStart[2] = 0xb5;
601 pchMessageStart[3] = 0xda;
602 nDefaultPort = 18444;
603 nPruneAfterHeight = opts.fastprune ? 100 : 1000;
604 m_assumed_blockchain_size = 0;
605 m_assumed_chain_state_size = 0;
606
607 ApplyDeploymentOptions(opts.dep_opts);
608
609 genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN);
610 consensus.hashGenesisBlock = genesis.GetHash();
611 assert(consensus.hashGenesisBlock == uint256{"0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"});
612 assert(genesis.hashMerkleRoot == uint256{"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"});
613
614 vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds.
615 vSeeds.clear();
616 vSeeds.emplace_back("dummySeed.invalid.");
617
618 fDefaultConsistencyChecks = true;
619 m_is_mockable_chain = true;
620
621 m_assumeutxo_data = {
622 { // For use by unit tests
623 .height = 110,
624 .hash_serialized = AssumeutxoHash{uint256{"86e9a1205b418b16dde3a18a78c730e30137e28466bda5dbf6b33ab8fc05447c"}},
625 .m_chain_tx_count = 111,

Callers

nothing calls this directly

Calls 5

CreateGenesisBlockFunction · 0.85
uint256Class · 0.70
clearMethod · 0.45
GetHashMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected