Skip to content

Commit

Permalink
fix chain params settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sdmg15 committed Dec 27, 2023
1 parent 86bcf11 commit 35b9958
Show file tree
Hide file tree
Showing 4 changed files with 403 additions and 285 deletions.
20 changes: 20 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,26 @@ void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& opti
throw std::runtime_error(strprintf("Invalid deployment (%s)", vDeploymentParams[0]));
}
}

if (auto anonRestrict = args.GetArg("-anonrestrictionstartheight")) {
if (!ParseInt32(anonRestrict.value(), &options.anonRestrictionStartHeight)) {
throw std::runtime_error(strprintf("Invalid anonrestrictionstartheight (%s)", anonRestrict.value()));
}
}

if (auto automatedGvrActivationHeight = args.GetArg("-automatedgvrstartheight")) {
if (!ParseInt32(automatedGvrActivationHeight.value(), &options.automatedGvrActivationHeight)) {
throw std::runtime_error(strprintf("Invalid automatedGvrActivationHeight (%s)", automatedGvrActivationHeight.value()));
}
}

if (auto bl = args.GetArg("-blacklistedanon")) {
options.blacklisted = bl.value();
}

if (auto ba = args.GetBoolArg("-anonrestricted"); ba.has_value()) {
options.anonRestricted = ba.value();
}
}

static std::unique_ptr<CChainParams> globalChainParams;
Expand Down
6 changes: 3 additions & 3 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const ChainType chain)
{
switch (chain) {
case ChainType::MAIN:
return std::make_unique<CBaseChainParams>("", 51735, 51734);
return std::make_unique<CBaseChainParams>("", 51725, 51734);
case ChainType::TESTNET:
return std::make_unique<CBaseChainParams>("testnet", 51935, 51934);
return std::make_unique<CBaseChainParams>("testnet", 51925, 51935);
case ChainType::SIGNET:
return std::make_unique<CBaseChainParams>("signet", 31932, 31934);
case ChainType::REGTEST:
return std::make_unique<CBaseChainParams>("regtest", 51936, 51931);
return std::make_unique<CBaseChainParams>("regtest", 51926, 51936);
}
assert(false);
}
Expand Down
Loading

0 comments on commit 35b9958

Please sign in to comment.