Browse Source

Merge pull request #848 from jl777/jl777

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

19
iguana/dpow/dpow_fsm.c

@ -408,9 +408,9 @@ void dpow_statemachinestart(void *ptr)
{ {
myind = i; myind = i;
ep = &bp->notaries[myind]; ep = &bp->notaries[myind];
for (j=0; j<33; j++) //for (j=0; j<33; j++)
printf("%02x",dp->minerkey33[j]); // printf("%02x",dp->minerkey33[j]);
printf(" MYIND.%d <<<<<<<<<<<<<<<<<<<<<<\n",myind); //printf(" MYIND.%d <<<<<<<<<<<<<<<<<<<<<<\n",myind);
} }
} }
if ( strcmp("KMD",src->symbol) == 0 ) if ( strcmp("KMD",src->symbol) == 0 )
@ -426,7 +426,7 @@ void dpow_statemachinestart(void *ptr)
exit(-1); exit(-1);
return; return;
} }
printf("myind.%d\n",myind); //printf("myind.%d\n",myind);
} }
else else
{ {
@ -437,10 +437,6 @@ void dpow_statemachinestart(void *ptr)
} }
bp->myind = myind; bp->myind = myind;
printf("[%d] notarize %s->%s %s ht.%d minsigs.%d duration.%d start.%u MoM[%d] %s\n",bp->myind,dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height,minsigs,duration,checkpoint.timestamp,bp->MoMdepth,bits256_str(str2,bp->MoM)); printf("[%d] notarize %s->%s %s ht.%d minsigs.%d duration.%d start.%u MoM[%d] %s\n",bp->myind,dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height,minsigs,duration,checkpoint.timestamp,bp->MoMdepth,bits256_str(str2,bp->MoM));
{
if ( strcmp(dp->symbol,"CHIPS") == 0 && bp->myind == 0 )
dpow_signedtxgen(myinfo,dp,src,bp,bp->myind,1LL<<bp->myind,bp->myind,DPOW_SIGCHANNEL,0,0);
}
if ( bp->isratify != 0 && memcmp(bp->notaries[0].pubkey,bp->ratified_pubkeys[0],33) != 0 ) if ( bp->isratify != 0 && memcmp(bp->notaries[0].pubkey,bp->ratified_pubkeys[0],33) != 0 )
{ {
for (i=0; i<33; i++) for (i=0; i<33; i++)
@ -490,6 +486,13 @@ void dpow_statemachinestart(void *ptr)
bp->notaries[myind].ratifydestvout = ep->dest.prev_vout; bp->notaries[myind].ratifydestvout = ep->dest.prev_vout;
} }
} }
if ( strcmp(dp->symbol,"CHIPS") == 0 && myind == 0 )
{
char str[65];
printf(">>>>>>> CHIPS myind.%d %s/v%d\n",myind,bits256_str(str,bp->notaries[myind].src.prev_hash),bp->notaries[myind].src.prev_vout);
bp->desttxid = bp->notaries[myind].src.prev_hash;
dpow_signedtxgen(myinfo,dp,src,bp,bp->myind,1LL<<bp->myind,bp->myind,DPOW_SIGCHANNEL,0,0);
}
bp->recvmask |= (1LL << myind); bp->recvmask |= (1LL << myind);
bp->notaries[myind].othermask |= (1LL << myind); bp->notaries[myind].othermask |= (1LL << myind);
dp->checkpoint = checkpoint; dp->checkpoint = checkpoint;

1
iguana/dpow/dpow_network.c

@ -1842,6 +1842,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
{ {
bp->notaries[senderind].src.prev_hash = srcutxo; bp->notaries[senderind].src.prev_hash = srcutxo;
bp->notaries[senderind].src.prev_vout = srcvout; bp->notaries[senderind].src.prev_vout = srcvout;
char str[65]; printf("%s senderind.%d <- %s/v%d\n",dp->symbol,senderind,bits256_str(str,srcutxo),srcvout);
} }
if ( bits256_nonz(destutxo) != 0 ) if ( bits256_nonz(destutxo) != 0 )
{ {

8
iguana/iguana_notary.c

@ -262,7 +262,7 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp)
} }
} }
} }
else if ( strcmp(dp->symbol,"KMD") == 0 ) else //if ( strcmp(dp->symbol,"KMD") == 0 )
{ {
while ( dp->lastheight <= height ) while ( dp->lastheight <= height )
{ {
@ -270,13 +270,13 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp)
dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime); dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime);
} }
} }
else if ( time(NULL) > dp->lastsrcupdate+60 || height != dp->lastheight ) /*else if ( time(NULL) > dp->lastsrcupdate+60 || height != dp->lastheight )
{ {
dp->lastsrcupdate = (uint32_t)time(NULL); dp->lastsrcupdate = (uint32_t)time(NULL);
dp->lastheight = height; dp->lastheight = height;
blockhash = dpow_getblockhash(myinfo,src,dp->lastheight); blockhash = dpow_getblockhash(myinfo,src,dp->lastheight);
dpow_srcupdate(myinfo,dp,dp->lastheight,blockhash,(uint32_t)time(NULL),blocktime); dpow_srcupdate(myinfo,dp,dp->lastheight,blockhash,(uint32_t)time(NULL),blocktime);
} }*/
} //else printf("error getchaintip for %s\n",dp->symbol); } //else printf("error getchaintip for %s\n",dp->symbol);
} else printf("iguana_dPoWupdate missing src.(%s) %p or dest.(%s) %p\n",dp->symbol,src,dp->dest,dest); } else printf("iguana_dPoWupdate missing src.(%s) %p or dest.(%s) %p\n",dp->symbol,src,dp->dest,dest);
} }
@ -366,7 +366,7 @@ THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq)
else else
{ {
dp->minsigs = Notaries_minsigs; //DPOW_MIN_ASSETCHAIN_SIGS; dp->minsigs = Notaries_minsigs; //DPOW_MIN_ASSETCHAIN_SIGS;
if ( strcmp("CHIPS",dp->symbol) == 0 || strncmp("TEST",dp->symbol,4) == 0) if ( freq == 0 && (strcmp("CHIPS",dp->symbol) == 0 || strncmp("TEST",dp->symbol,4) == 0) )
dp->freq = DPOW_MAXFREQ; dp->freq = DPOW_MAXFREQ;
else if ( freq > 2 ) else if ( freq > 2 )
dp->freq = freq; dp->freq = freq;

Loading…
Cancel
Save