Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2469,6 +2469,17 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
LogPrintf(" warning='%s'", warningMessages); /* Continued */
LogPrintf("\n");

// Do some logging if dynafed parameters changed.
if (pindexNew->pprev && !pindexNew->dynafed_params.IsNull()) {
int height = pindexNew->nHeight;
uint256 hash = pindexNew->GetBlockHash();
uint256 root = pindexNew->dynafed_params.m_current.CalculateRoot();
if (pindexNew->pprev->dynafed_params.IsNull()) {
LogPrintf("Dynafed activated in block %d:%s: %s\n", height, hash.GetHex(), root.GetHex());
} else if (root != pindexNew->pprev->dynafed_params.m_current.CalculateRoot()) {
LogPrintf("New dynafed parameters activated in block %d:%s: %s\n", height, hash.GetHex(), root.GetHex());
}
}
}

/** Disconnect chainActive's tip.
Expand Down Expand Up @@ -3565,19 +3576,6 @@ static bool ContextualCheckDynaFedHeader(const CBlockHeader& block, CValidationS
}
}

// Do some logging if parameters changed.
auto parent = pindexPrev->dynafed_params.m_current;
if (dynafed_params.m_current != parent) {
int height = pindexPrev->nHeight + 1;
std::string hash = block.GetHash().GetHex();
std::string root = dynafed_params.m_current.CalculateRoot().GetHex();
if (parent.IsNull()) {
LogPrintf("Dynafed activated in block %d:%s: %s\n", height, hash, root);
} else {
LogPrintf("New dynafed parameters activated in block %d:%s: %s\n", height, hash, root);
}
}

return true;
}

Expand Down