From 06a9043d9ec8134115e6d13e2949c7f050fb4bdb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 13 Nov 2016 13:12:29 -0300 Subject: [PATCH] test --- iguana/dPoW.h | 2 +- iguana/dpow/dpow_fsm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index c83e0c79d..154b6be43 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -99,7 +99,7 @@ struct dpow_block uint64_t destsigsmasks[DPOW_MAXRELAYS],srcsigsmasks[DPOW_MAXRELAYS]; uint64_t recvmask,bestmask,ratifybestmask,ratifyrecvmask,pendingbestmask,pendingratifybestmask,ratifysigmasks[2]; struct dpow_entry notaries[DPOW_MAXRELAYS]; - uint32_t state,timestamp,waiting,sigcrcs[2],txidcrcs[2],utxocrcs[2]; + uint32_t state,starttime,timestamp,waiting,sigcrcs[2],txidcrcs[2],utxocrcs[2]; int32_t height,numnotaries,completed,minsigs,duration,numratified,isratify,require0,scores[DPOW_MAXRELAYS]; int8_t bestk,ratifybestk,pendingbestk,pendingratifybestk; cJSON *ratified; diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index fc15a88f0..69fd96d76 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -135,7 +135,7 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,struc if ( bp->state != 0xffffffff ) { bp->srctxid = txid; - printf("set state COMPLETED %s.(%s) %s.(%s)\n",dp->symbol,bits256_str(str,bp->desttxid),dp->dest,bits256_str(str2,txid)); + printf("set state elapsed %d COMPLETED %s.(%s) %s.(%s)\n",(int32_t)(time(NULL) - bp->starttime),dp->symbol,bits256_str(str,bp->desttxid),dp->dest,bits256_str(str2,txid)); bp->state = 0xffffffff; } } @@ -341,7 +341,7 @@ void dpow_statemachinestart(void *ptr) sleep(1); } if ( bp->isratify == 0 || (starttime= checkpoint.timestamp) == 0 ) - starttime = (uint32_t)time(NULL); + bp->starttime = starttime = (uint32_t)time(NULL); printf("isratify.%d DPOW.%s statemachine checkpoint.%d %s start.%u\n",bp->isratify,src->symbol,checkpoint.blockhash.height,bits256_str(str,checkpoint.blockhash.hash),checkpoint.timestamp); for (i=0; iminerkey33[i+1];