src/governance-object.cpp
/**
*   LoadData
*   --------------------------------------------------------
*
*   Attempt to load data from vchData
*
*/
LoadData
Attempt to load data from vchData
LoadData Attempt to load data from vchData
void CGovernanceObject::LoadData()
{
    if (vchData.empty()) {
        return;
    }
    try {
        UniValue objResult(UniValue::VOBJ);
        GetData(objResult);
        LogPrint("gobject", "CGovernanceObject::LoadData -- GetDataAsPlainString = %s\n", GetDataAsPlainString());
        UniValue obj = GetJSONObject();
        nObjectType = obj["type"].get_int();
    } catch (std::exception& e) {
        fUnparsable = true;
        std::ostringstream ostr;
        ostr << "CGovernanceObject::LoadData Error parsing JSON"
             << ", e.what() = " << e.what();
        LogPrintf("%s\n", ostr.str());
        return;
    } catch (...) {
        fUnparsable = true;
        std::ostringstream ostr;
        ostr << "CGovernanceObject::LoadData Unknown Error parsing JSON";
        LogPrintf("%s\n", ostr.str());
        return;
    }
}
void CGovernanceObject :: LoadData ( ) { if ( vchData . empty ( ) ) { return ; } try { UniValue objResult ( UniValue :: VOBJ ) ; GetData ( objResult ) ; LogPrint ( " " , " \n " , GetDataAsPlainString ( ) ) ; UniValue obj = GetJSONObject ( ) ; nObjectType = obj [ " " ] . get_int ( ) ; } catch ( std :: exception & e ) { fUnparsable = true ; std :: ostringstream ostr ; ostr << " " << " " << e . what ( ) ; LogPrintf ( " \n " , ostr . str ( ) ) ; return ; } catch ( ... ) { fUnparsable = true ; std :: ostringstream ostr ; ostr << " " ; LogPrintf ( " \n " , ostr . str ( ) ) ; return ; } }
LoadData
Attempt to load data from vchData
LoadData Attempt to load data from vchData
// ATTEMPT TO LOAD JSON STRING FROM VCHDATA