function update_market_info()
{
    if (TRY_CMC) {
        $info = fetch_cmc_market_info();
    } else {
        $info = FALSE;
    }
    if ($info == FALSE || $info['price'] == 0 || $info['market_cap'] == 0 || $info['total_supply'] == 0) {
        echo "*falling back to alt data sources*\n";
        $info = fetch_alternative_market_info();
    }
    $info['updated'] = time();
    file_put_contents(DATA_PATH, json_encode($info));
}
function update_market_info() {
    $info = fetch_cmc_market_info(); // CMC sourced

    if ($info['price'] == 0) { // CMC is freaking out, grab from Vircurex instead
        // Grab our old market info for reference to use its total supply
        $old_info = market_info();

        // "Dumb mode" only updates price and market cap, not total supply (can add later)
        $price = fetch_vircurex_market_price();
        $market_cap = $price * $old_info['total_supply']; // Calculate a market cap based on Vircurex price and last known supply
        
        $info['price'] = $price;
        $info['market_cap'] = round($market_cap, 2);
        $info['total_supply'] = $old_info['total_supply'];
    }

    $info['updated'] = time();
    file_put_contents(DATA_PATH, json_encode($info));

}