src/omnicore/consensushash.cpp
// Generates a consensus string for hashing based on a tally object
Generates a consensus string for hashing based on a tally object
Generates a consensus string for hashing based on a tally object
std::string GenerateConsensusString(const CMPTally& tallyObj, const std::string& address, const uint32_t propertyId)
{
    int64_t balance = tallyObj.getMoney(propertyId, BALANCE);
    int64_t sellOfferReserve = tallyObj.getMoney(propertyId, SELLOFFER_RESERVE);
    int64_t acceptReserve = tallyObj.getMoney(propertyId, ACCEPT_RESERVE);
    if (!balance && !sellOfferReserve && !acceptReserve) return "";
    return strprintf("%s|%d|%d|%d|%d",
            address, propertyId, balance, sellOfferReserve, acceptReserve);
}
std :: string GenerateConsensusString ( const CMPTally & tallyObj , const std :: string & address , const uint32_t propertyId ) { int64_t balance = tallyObj . getMoney ( propertyId , BALANCE ) ; int64_t sellOfferReserve = tallyObj . getMoney ( propertyId , SELLOFFER_RESERVE ) ; int64_t acceptReserve = tallyObj . getMoney ( propertyId , ACCEPT_RESERVE ) ; if ( ! balance && ! sellOfferReserve && ! acceptReserve ) return " " ; return strprintf ( " " , address , propertyId , balance , sellOfferReserve , acceptReserve ) ; }
Generates a consensus string for hashing based on a tally object
Generates a consensus string for hashing based on a tally object
// return a blank string if all balances are empty