Skip to content

Commit d938098

Browse files
dongcarlTheCharlatan
authored andcommitted
Remove UpdateVersionBitsParameters
Moves setting struct member fields from a function to its call site. This improves readability by surfacing the code.
1 parent 84b8578 commit d938098

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/chainparams.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,9 @@ class CRegTestParams : public CChainParams
463463
}
464464

465465
for (const auto& [deployment_pos, version_bits_params] : opts.version_bits_parameters) {
466-
UpdateVersionBitsParameters(deployment_pos, version_bits_params.start_time, version_bits_params.timeout, version_bits_params.min_activation_height);
466+
consensus.vDeployments[deployment_pos].nStartTime = version_bits_params.start_time;
467+
consensus.vDeployments[deployment_pos].nTimeout = version_bits_params.timeout;
468+
consensus.vDeployments[deployment_pos].min_activation_height = version_bits_params.min_activation_height;
467469
}
468470

469471
genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN);
@@ -511,16 +513,6 @@ class CRegTestParams : public CChainParams
511513

512514
bech32_hrp = "bcrt";
513515
}
514-
515-
/**
516-
* Allows modifying the Version Bits regtest parameters.
517-
*/
518-
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int min_activation_height)
519-
{
520-
consensus.vDeployments[d].nStartTime = nStartTime;
521-
consensus.vDeployments[d].nTimeout = nTimeout;
522-
consensus.vDeployments[d].min_activation_height = min_activation_height;
523-
}
524516
};
525517

526518
void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& options)

0 commit comments

Comments
 (0)