From fa8cbaba9f494a2298b253741d939bc6a1b9680f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 26 Jun 2016 11:29:06 -0300 Subject: [PATCH] test --- gecko/gecko_miner.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gecko/gecko_miner.c b/gecko/gecko_miner.c index 04372854c..c848a98eb 100755 --- a/gecko/gecko_miner.c +++ b/gecko/gecko_miner.c @@ -17,9 +17,13 @@ uint32_t gecko_earliest_blocktime(int32_t estblocktime,uint32_t prevtimestamp) { + uint32_t timestamp,now = (uint32_t)time(NULL); if ( prevtimestamp == 0 ) - prevtimestamp = (uint32_t)time(NULL); - return(prevtimestamp + ((estblocktime << 1) / 3)); + prevtimestamp = now; + timestamp = (prevtimestamp + ((estblocktime << 1) / 3)); + if ( timestamp < now ) + timestamp = now; + return(timestamp); } int32_t gecko_blocknonce_verify(struct iguana_info *virt,uint8_t *serialized,int32_t datalen,uint32_t nBits,uint32_t timestamp,uint32_t prevtimestamp)