asan: lock cs_main for calls to chainman

This commit is contained in:
Byron Hambly 2025-01-06 13:58:28 +02:00
parent ffa0c01a17
commit c794f76ea8
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697
4 changed files with 13 additions and 7 deletions

View file

@ -1100,7 +1100,8 @@ static RPCHelpMan getnewblockhex()
// Construct proposed parameter entry, if any
DynaFedParamEntry proposed;
if (!request.params[1].isNull()) {
if (!DeploymentActiveAfter(chainman.ActiveChain().Tip(), chainman, Consensus::DEPLOYMENT_DYNA_FED)) {
auto tip = WITH_LOCK(::cs_main, return chainman.ActiveChain().Tip());
if (!DeploymentActiveAfter(tip, chainman, Consensus::DEPLOYMENT_DYNA_FED)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Dynamic federations is not active on this network. Proposed parameters are not needed.");
}