Add logging for dynafed activation and transitions

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

View file

@ -2695,6 +2695,18 @@ static void UpdateTip(CTxMemPool& mempool, const CBlockIndex* pindexNew, const C
if (num_unexpected_version > 0) {
LogPrint(BCLog::VALIDATION, "%d of last 100 blocks have unexpected version\n", num_unexpected_version);
}
// 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 m_chain's tip.