refactor: drop usage of chainstate globals in spork logic

This commit is contained in:
Kittywhiskers Van Gogh 2024-06-26 11:48:57 +00:00
parent 208b1c079b
commit 0f4184cd70
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -149,8 +149,7 @@ PeerMsgRet CSporkManager::ProcessSpork(const CNode& peer, PeerManager& peerman,
{
LOCK(cs_main);
EraseObjectRequest(peer.GetId(), CInv(MSG_SPORK, hash));
if (!::ChainActive().Tip()) return {};
strLogMsg = strprintf("SPORK -- hash: %s id: %d value: %10d bestHeight: %d peer=%d", hash.ToString(), spork.nSporkID, spork.nValue, ::ChainActive().Height(), peer.GetId());
strLogMsg = strprintf("SPORK -- hash: %s id: %d value: %10d peer=%d", hash.ToString(), spork.nSporkID, spork.nValue, peer.GetId());
}
if (spork.nTimeSigned > GetAdjustedTime() + 2 * 60 * 60) {