Browse Source

Update time after processing transactions which can be delayed.

master
Con Kolivas 8 years ago
parent
commit
962351034d
  1. 13
      src/stratifier.c

13
src/stratifier.c

@ -1410,7 +1410,6 @@ static void block_update(ckpool_t *ckp, int *prio)
bool ret = false; bool ret = false;
txntable_t *txns; txntable_t *txns;
workbase_t *wb; workbase_t *wb;
time_t now_t;
retry: retry:
wb = generator_getbase(ckp); wb = generator_getbase(ckp);
@ -1456,12 +1455,6 @@ retry:
generate_coinbase(ckp, wb); generate_coinbase(ckp, wb);
add_base(ckp, sdata, wb, &new_block); add_base(ckp, sdata, wb, &new_block);
/* Reset the update time to avoid stacked low priority notifies. Bring
* forward the next notify in case of a new block. */
now_t = time(NULL);
if (new_block)
now_t -= ckp->update_interval / 2;
sdata->update_time = now_t;
if (new_block) if (new_block)
LOGNOTICE("Block hash changed to %s", sdata->lastswaphash); LOGNOTICE("Block hash changed to %s", sdata->lastswaphash);
@ -1472,7 +1465,13 @@ retry:
* propagation. */ * propagation. */
if (likely(txns)) if (likely(txns))
update_txns(ckp, sdata, txns, true); update_txns(ckp, sdata, txns, true);
/* Reset the update time to avoid stacked low priority notifies. Bring
* forward the next notify in case of a new block. */
sdata->update_time = time(NULL);
if (new_block)
sdata->update_time -= ckp->update_interval / 2;
out: out:
cksem_post(&sdata->update_sem); cksem_post(&sdata->update_sem);
/* Send a ping to miners if we fail to get a base to keep them /* Send a ping to miners if we fail to get a base to keep them

Loading…
Cancel
Save