LoadChainTip requires cs_main to be locked. Under some conditions, it may call ActivateBestChain. However, ActivateBestChain requires cs_main NOT to be taken when called.
{
    AssertLockHeld(cs_main);
    
    
    
    
    
    
    flags = std::max(flags, 0);
    
    
    
    
    
    
    const int nBlockHeight = ::ChainActive().Height() + 1;
    
    
    
    
    
    const int64_t nBlockTime = (flags & LOCKTIME_MEDIAN_TIME_PAST)
                             ? ::ChainActive().Tip()->GetMedianTimePast()
                             : GetAdjustedTime();
    return IsFinalTx(tx, nBlockHeight, nBlockTime);
}
bool TestLockPointValidity(const LockPoints* lp)