Browse Source

Merge pull request #780 from jl777/jl777

Jl777
patch-3
jl777 7 years ago
committed by GitHub
parent
commit
4bb4c9e26c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      iguana/dpow/dpow_fsm.c
  2. 2
      iguana/dpow/dpow_network.c
  3. 8
      iguana/iguana_notary.c
  4. 3
      iguana/m_notary_run

9
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 )

2
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);
}
}

8
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));

3
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
@ -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\"}"

Loading…
Cancel
Save