Remove UpdateVersionBitsParameters

Moves setting struct member fields from a function to its call site.
This improves readability by surfacing the code.
This commit is contained in:
Carl Dong 2022-03-09 16:17:46 -05:00 committed by TheCharlatan
parent 84b85786f0
commit d938098398
No known key found for this signature in database
GPG key ID: 9B79B45691DB4173

View file

@ -463,7 +463,9 @@ public:
}
for (const auto& [deployment_pos, version_bits_params] : opts.version_bits_parameters) {
UpdateVersionBitsParameters(deployment_pos, version_bits_params.start_time, version_bits_params.timeout, version_bits_params.min_activation_height);
consensus.vDeployments[deployment_pos].nStartTime = version_bits_params.start_time;
consensus.vDeployments[deployment_pos].nTimeout = version_bits_params.timeout;
consensus.vDeployments[deployment_pos].min_activation_height = version_bits_params.min_activation_height;
}
genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN);
@ -511,16 +513,6 @@ public:
bech32_hrp = "bcrt";
}
/**
* Allows modifying the Version Bits regtest parameters.
*/
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int min_activation_height)
{
consensus.vDeployments[d].nStartTime = nStartTime;
consensus.vDeployments[d].nTimeout = nTimeout;
consensus.vDeployments[d].min_activation_height = min_activation_height;
}
};
void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& options)