From f9a24d4a974b7b0d91fa5ea482e8641f3b849d32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 17 Oct 2016 10:50:41 -0300 Subject: [PATCH] test --- iguana/dpow/dpow_fsm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 2c9d44c8f..90c8350a8 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -334,7 +334,7 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info opret_symbol = dp->symbol; } bitcoin_address(coinaddr,coin->chain->pubtype,myinfo->DPOW.minerkey33,33); - if ( bits256_nonz(bp->hashmsg) == 0 ) + if ( bits256_nonz(bp->hashmsg) == 0 && bp->height != 0 ) return(0); for (j=0; jDPOW.minerkey33[j+1]; @@ -385,8 +385,8 @@ void dpow_statemachinestart(void *ptr) memset(&zero,0,sizeof(zero)); myinfo = ptrs[0]; dp = ptrs[1]; - minsigs = (uint32_t)ptrs[2]; - duration = (uint32_t)ptrs[3]; + minsigs = (uint32_t)(long)ptrs[2]; + duration = (uint32_t)(long)ptrs[3]; jsonstr = ptrs[4]; dp->destupdated = 0; // prevent another state machine till next BTC block memcpy(&checkpoint,&ptrs[5],sizeof(checkpoint)); @@ -478,7 +478,7 @@ void dpow_statemachinestart(void *ptr) while ( time(NULL) < starttime+bp->duration && src != 0 && dest != 0 && bp->state != 0xffffffff ) { sleep(2); - if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height ) + if ( checkpoint.blockhash.height != 0 && dp->checkpoint.blockhash.height > checkpoint.blockhash.height ) { printf("abort ht.%d due to new checkpoint.%d\n",checkpoint.blockhash.height,dp->checkpoint.blockhash.height); break; @@ -489,7 +489,10 @@ void dpow_statemachinestart(void *ptr) bp->state = dpow_statemachineiterate(myinfo,dp,dest,bp,myind,1); } if ( myinfo->DPOW.cancelratify != 0 && checkpoint.blockhash.height == 0 ) + { + printf("abort pending ratify\n"); break; + } } printf("state machine ht.%d completed state.%x %s.%s %s.%s\n",bp->height,bp->state,dp->dest,bits256_str(str,bp->desttxid),dp->symbol,bits256_str(str2,bp->srctxid)); free(ptr);