forex.pm forex forum binary options trade

 Сryptocurrency exchanges => Binance - Сryptocurrency exchanges => Topic started by: Bitcoin on Mar 30, 2022, 05:37 am

Title: Can*t call chainActive.Tip()->nHeight in core.cpp
Post by: Bitcoin on Mar 30, 2022, 05:37 am
Can*t call chainActive.Tip()->nHeight in core.cpp

I want to call chainActive.Tip()->nHeight in core.cpp. It is not possible, I am interested in every idea.



https://github.com/LIMXTEC/BitSend/blob/DEV-joshafest/src/core.cpp



Here is an example :



bool GetH()
{   
    int nBlockHeight = chainActive.Tip()->nHeight; 
    if(nBlockHeight < FORKX17_Main_Net )
        return true;   
    else
        return false;
    }
}

uint256 CBlockHeader::GetHash() const
{   
    if (GetH())     
    {
        return HashX11(BEGIN(nVersion), END(nNonce));
    }
    else   
    {
       return HashX17(BEGIN(nVersion), END(nNonce));   
    }
}


Also that is not possible:



CBlockIndex* pindexPrev = chainActive.Tip();
if (pindexPrev->nHeight <= FORKX17_Main_Net)


enter image description here


Source: Can*t call chainActive.Tip()->nHeight in core.cpp (https://bitcoin.stackexchange.com/questions/46171/cant-call-chainactive-tip-nheight-in-core-cpp)