Add logging for dynafed activation and transitions

This commit is contained in:
Steven Roose 2021-05-07 15:45:00 +02:00
parent b1a40781c6
commit ca827fcd75
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87

View file

@ -3555,6 +3555,20 @@ 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;
}