From 9bd6e83700c3d44b624424eafc8946dcfc6ac5c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Oct 2017 15:23:38 +0300 Subject: [PATCH] Test --- iguana/iguana_notary.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 5e61662f6..427fdd37f 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -160,15 +160,19 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he { height = jint(blockjson,"height"); blocktime = juint(blockjson,"time"); + free_json(blockjson); if ( height > 0 && blocktime > 0 ) + { dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); - free_json(blockjson); - if ( bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) + printf("dynamic set %s <- height.%d\n",bits256_str(str,hash),height); + } + else return; + if ( bits256_nonz(dp->activehash) != 0 && bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) { printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); return; } - if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) + else if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) { printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); return; @@ -264,7 +268,7 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) if ( (height= dpow_getchaintip(myinfo,&blockhash,&blocktime,dp->desttx,&dp->numdesttx,dest)) != dp->destchaintip.blockhash.height && height >= 0 ) { char str[65]; - if ( strcmp(dp->symbol,"KMD") == 0 || height != dp->destchaintip.blockhash.height+1 ) + if ( strcmp(dp->symbol,"KMD") == 0 )//|| height != dp->destchaintip.blockhash.height+1 ) printf("[%s].%d %s %s height.%d vs last.%d\n",dp->symbol,dp->SRCHEIGHT,dp->dest,bits256_str(str,blockhash),height,dp->destchaintip.blockhash.height); if ( height <= dp->destchaintip.blockhash.height ) {