From bdf483520b1cdc7a8a9c7e2dc8c9c0bb78dcd2b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 11:57:24 +0300 Subject: [PATCH 1/4] -MoM for KMD --- iguana/dpow/dpow_fsm.c | 9 ++++++--- iguana/m_notary_run | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index a9f479a55..a7fca399c 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -439,9 +439,12 @@ void dpow_statemachinestart(void *ptr) return; } MoMdepth = 0; - portable_mutex_lock(&src->MoM_mutex); - MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); - portable_mutex_unlock(&src->MoM_mutex); + if ( strcmp(dp->dest,"KMD") == 0 ) + { + portable_mutex_lock(&src->MoM_mutex); + MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); + portable_mutex_unlock(&src->MoM_mutex); + } else memset(&MoM,0,sizeof(MoM)); if ( strcmp(src->symbol,"KMD") == 0 ) kmdheight = checkpoint.blockhash.height; else if ( strcmp(dest->symbol,"KMD") == 0 ) diff --git a/iguana/m_notary_run b/iguana/m_notary_run index 3eaa49dff..fc9ad6ac2 100755 --- a/iguana/m_notary_run +++ b/iguana/m_notary_run @@ -53,4 +53,5 @@ coins/prlpay_7776 #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"passthru\",\"method\":\"paxfiats\",\"timeout\":900000}" #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}" +sleep 30 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}" From 48e5b60bdc11c0b13d6079fd3598ef6f51c39f6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 11:59:26 +0300 Subject: [PATCH 2/4] -ltc_7776 --- iguana/m_notary_run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/m_notary_run b/iguana/m_notary_run index fc9ad6ac2..a36cbfa04 100755 --- a/iguana/m_notary_run +++ b/iguana/m_notary_run @@ -18,7 +18,7 @@ curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\" sleep 3 tests/addnotarys_7776 coins/btc_7776 -coins/ltc_7776 +#coins/ltc_7776 coins/kmd_7776 coins/chips_7776 ./wp_7776 From 3d652d791e79f51b3467093d93cc2409e45c9a43 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 12:24:13 +0300 Subject: [PATCH 3/4] -print --- iguana/iguana_notary.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 66d727f5b..ecaa0b084 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -76,7 +76,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he else freq = 1; } dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); - if ( strcmp(dp->dest,"KMD") == 0 || strcmp(dp->dest,"CHAIN") == 0 ) + if ( strcmp(dp->dest,"KMD") == 0 )//|| strcmp(dp->dest,"CHAIN") == 0 ) { //if ( dp->SRCREALTIME == 0 ) // return; @@ -97,7 +97,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he if ( height > 0 && blocktime > 0 ) { dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); - if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) printf("dynamic set %s/%s %s <- height.%d\n",dp->symbol,dp->dest,bits256_str(str,hash),height); checkpoint = dp->last; } else return; @@ -111,7 +111,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); return; } - if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); } else return; } else return; @@ -120,7 +120,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he } if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) { - if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); dpow_heightfind(myinfo,dp,checkpoint.blockhash.height + 1000); ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint) + sizeof(pthread_t)); From 4028859ea8ed166ad43cdb61409b95a88b10063b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 12:25:53 +0300 Subject: [PATCH 4/4] +print --- iguana/dpow/dpow_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 3709aa0fc..8a10066fe 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1901,7 +1901,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru printf("mypaxcrc.%x\n",bp->paxwdcrc); } char str[65]; - if ( (rand() % 130) == 0 || strcmp(dp->symbol,"CHIPS") == 0 ) + if ( (rand() % 130) == 0 || strcmp(dp->symbol,"KMD") == 0 ) printf("%p ht.%d [%d] ips.%d %s NOTARIZE.%d matches.%d paxmatches.%d bestmatches.%d bestk.%d %llx recv.%llx sigmasks.(%llx %llx) senderind.%d state.%x (%x %x %x) MoM.%s [%d]\n",bp,bp->height,bp->myind,dp->numipbits,dp->symbol,bp->minsigs,matches,paxmatches,bestmatches,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask,(long long)(bp->bestk>=0?bp->destsigsmasks[bp->bestk]:0),(long long)(bp->bestk>=0?bp->srcsigsmasks[bp->bestk]:0),senderind,bp->state,bp->hashmsg.uints[0],bp->desttxid.uints[0],bp->srctxid.uints[0],bits256_str(str,bp->MoM),bp->MoMdepth); } }