Skip to content

Commit

Permalink
Show Current Block Height under pools api
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshilliard committed Apr 5, 2016
1 parent 9bb7b15 commit 225097e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2574,6 +2574,7 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
(double)(pool->diff_stale) / (double)(pool->diff_accepted + pool->diff_rejected + pool->diff_stale) : 0;
root = api_add_percent(root, "Pool Stale%", &stalep, false);
root = api_add_uint64(root, "Bad Work", &(pool->bad_work), true);
root = api_add_uint32(root, "Current Block Height", &(pool->current_height), true);

root = print_data(io_data, root, isjson, isjson && (i > 0));
}
Expand Down
3 changes: 3 additions & 0 deletions cgminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -4780,6 +4780,9 @@ static bool test_work_current(struct work *work)
pool->swork.clean = false;
work->longpoll = true;
}
if (pool->current_height != height) {
pool->current_height = height;
}
cg_wunlock(&pool->data_lock);

/* Search to see if this block exists yet and if not, consider it a
Expand Down
1 change: 1 addition & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ struct pool {
char ntime[12];
double next_diff;
double sdiff;
uint32_t current_height;

struct timeval tv_lastwork;
};
Expand Down

0 comments on commit 225097e

Please sign in to comment.