Skip to content

Commit

Permalink
Show "?" for income if block height is unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Oct 29, 2014
1 parent 3499f56 commit 71324db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -4319,9 +4319,14 @@ one_workable_pool: ;
cg_mvwprintw(statuswin, 3, 0, " Block: %s Diff:%s (%s) Started: %s",
goal->current_goal_detail, goal->current_diff_str, goal->net_hashrate, blkchain->block_time_str);

income = total_diff_accepted * 3600 * blkchain->currentblk_subsidy / total_secs / goal->current_diff;
char bwstr[(ALLOC_H2B_SHORT*2)+3+1], incomestr[ALLOC_H2B_SHORT+6+1];
format_unit3(incomestr, sizeof(incomestr), FUP_BTC, "BTC/hr", H2B_SHORT, income/1e8, -1);
if (blkchain->currentblk->height)
{
income = total_diff_accepted * 3600 * blkchain->currentblk_subsidy / total_secs / goal->current_diff;
format_unit3(incomestr, sizeof(incomestr), FUP_BTC, "BTC/hr", H2B_SHORT, income/1e8, -1);
}
else
strcpy(incomestr, "?");
cg_mvwprintw(statuswin, 4, 0, " ST:%d F:%d NB:%d AS:%d BW:[%s] E:%.2f I:%s BS:%s",
ts,
total_go + total_ro,
Expand Down

0 comments on commit 71324db

Please sign in to comment.