From 6674de5b76b1c7750358a2c8f170b3479450e2aa Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 12 Nov 2014 15:56:26 -0800 Subject: [PATCH] use checkpoint progress to get time left. --- src/bitcoindjs.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index f9c70d03..9e8f16de 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -1839,20 +1839,20 @@ async_get_progress_after(uv_work_t *req) { Local genesis = NanNew(); cblock_to_jsblock(cgenesis, NULL, genesis, false); - int64_t ts_ = cblock.GetBlockTime(); + // int64_t ts_ = cblock.GetBlockTime(); time_t now_ = time(NULL); //int64_t now = (int64_t)(time(NULL) - (10 * 60)); - int64_t ts = (int64_t)ts_; + // int64_t ts = (int64_t)ts_; // Assume last block was ten minutes ago: int64_t now = ((int64_t)now_ - (10 * 60)); - int64_t left = (now - ts); // get left from timestamp + // int64_t left = (now - ts); // get left from timestamp // double cur = (double)(now - left) / (double)now; double cur = Checkpoints::GuessVerificationProgress(cblock_index, false); - // int64_t left = now - (cur * now); // get left from guess checkpoints + int64_t left = now - (cur * now); // get left from guess checkpoints unsigned int hours_behind = left / 60 / 60; unsigned int days_behind = left / 60 / 60 / 24;