src/spork.cpp
// grab the value of the spork on the network, or the default
grab the value of the spork on the network, or the default
grab the value of the spork on the network or the default
int64_t GetSporkValue(int nSporkID)
{
    int64_t r = -1;
    if (mapSporksActive.count(nSporkID)) {
        r = mapSporksActive[nSporkID].nValue;
    } else {
        if (nSporkID == SPORK_2_SWIFTTX) r = SPORK_2_SWIFTTX_DEFAULT;
        if (nSporkID == SPORK_3_SWIFTTX_BLOCK_FILTERING) r = SPORK_3_SWIFTTX_BLOCK_FILTERING_DEFAULT;
        if (nSporkID == SPORK_5_MAX_VALUE) r = SPORK_5_MAX_VALUE_DEFAULT;
        if (nSporkID == SPORK_7_MASTERNODE_SCANNING) r = SPORK_7_MASTERNODE_SCANNING_DEFAULT;
        if (nSporkID == SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT) r = SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT_DEFAULT;
        if (nSporkID == SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT) r = SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT_DEFAULT;
        if (nSporkID == SPORK_10_MASTERNODE_PAY_UPDATED_NODES) r = SPORK_10_MASTERNODE_PAY_UPDATED_NODES_DEFAULT;
        if (nSporkID == SPORK_11_RESET_BUDGET) r = SPORK_11_RESET_BUDGET_DEFAULT;
        if (nSporkID == SPORK_12_RECONSIDER_BLOCKS) r = SPORK_12_RECONSIDER_BLOCKS_DEFAULT;
        if (nSporkID == SPORK_13_ENABLE_SUPERBLOCKS) r = SPORK_13_ENABLE_SUPERBLOCKS_DEFAULT;
        if (nSporkID == SPORK_14_NEW_PROTOCOL_ENFORCEMENT) r = SPORK_14_NEW_PROTOCOL_ENFORCEMENT_DEFAULT;
        if (nSporkID == SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) r = SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT;
        if (nSporkID == SPORK_16_MN_WINNER_MINIMUM_AGE) r = SPORK_16_MN_WINNER_MINIMUM_AGE_DEFAULT;
        if (nSporkID == SPORK_17_PROPOSAL_VETO) r = SPORK_17_PROPOSAL_VETO_DEFAULT;
        if (nSporkID == SPORK_18_FAKE_STAKE_FIX) r = SPORK_18_FAKE_STAKE_FIX_DEFAULT;
        if (r == -1) LogPrintf("GetSpork::Unknown Spork %d\n", nSporkID);
    }
    return r;
}
int64_t GetSporkValue ( int nSporkID ) { int64_t r = -1 ; if ( mapSporksActive . count ( nSporkID ) ) { r = mapSporksActive [ nSporkID ] . nValue ; } else { if ( nSporkID == SPORK_2_SWIFTTX ) r = SPORK_2_SWIFTTX_DEFAULT ; if ( nSporkID == SPORK_3_SWIFTTX_BLOCK_FILTERING ) r = SPORK_3_SWIFTTX_BLOCK_FILTERING_DEFAULT ; if ( nSporkID == SPORK_5_MAX_VALUE ) r = SPORK_5_MAX_VALUE_DEFAULT ; if ( nSporkID == SPORK_7_MASTERNODE_SCANNING ) r = SPORK_7_MASTERNODE_SCANNING_DEFAULT ; if ( nSporkID == SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT ) r = SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT_DEFAULT ; if ( nSporkID == SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT ) r = SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT_DEFAULT ; if ( nSporkID == SPORK_10_MASTERNODE_PAY_UPDATED_NODES ) r = SPORK_10_MASTERNODE_PAY_UPDATED_NODES_DEFAULT ; if ( nSporkID == SPORK_11_RESET_BUDGET ) r = SPORK_11_RESET_BUDGET_DEFAULT ; if ( nSporkID == SPORK_12_RECONSIDER_BLOCKS ) r = SPORK_12_RECONSIDER_BLOCKS_DEFAULT ; if ( nSporkID == SPORK_13_ENABLE_SUPERBLOCKS ) r = SPORK_13_ENABLE_SUPERBLOCKS_DEFAULT ; if ( nSporkID == SPORK_14_NEW_PROTOCOL_ENFORCEMENT ) r = SPORK_14_NEW_PROTOCOL_ENFORCEMENT_DEFAULT ; if ( nSporkID == SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2 ) r = SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT ; if ( nSporkID == SPORK_16_MN_WINNER_MINIMUM_AGE ) r = SPORK_16_MN_WINNER_MINIMUM_AGE_DEFAULT ; if ( nSporkID == SPORK_17_PROPOSAL_VETO ) r = SPORK_17_PROPOSAL_VETO_DEFAULT ; if ( nSporkID == SPORK_18_FAKE_STAKE_FIX ) r = SPORK_18_FAKE_STAKE_FIX_DEFAULT ; if ( r == -1 ) LogPrintf ( " \n " , nSporkID ) ; } return r ; }
grab the value of the spork on the network, or the default
grab the value of the spork on the network or the default