jl777 8 years ago
parent
commit
63f84564c4
  1. 20
      iguana/iguana_notary.c
  2. 3
      iguana/notaries.h

20
iguana/iguana_notary.c

@ -709,7 +709,7 @@ void dpow_statemachinestart(void *ptr)
dp->checkpoint = checkpoint;
srchash = checkpoint.blockhash;
desthash = dp->notarized[0];
printf("DPOW statemachine checkpoint.%d src.%p dest.%p\n",checkpoint.blockhash.height,src,dest);
printf("DPOW statemachine checkpoint.%d %s\n",checkpoint.blockhash.height,bits256_str(str,checkpoint.blockhash.hash));
while ( src != 0 && dest != 0 && (srcstate != 0xffffffff || deststate != 0xffffffff) )
{
sleep(10);
@ -718,10 +718,13 @@ void dpow_statemachinestart(void *ptr)
printf("abort ht.%d due to new checkpoint.%d\n",checkpoint.blockhash.height,dp->checkpoint.blockhash.height);
break;
}
if ( srcstate == 0 )
srcstate = dpow_statemachineiterate(myinfo,dp,src,srcstate,srchash.hash,srchash.height,notaries,n,myind,&recvmask,&signedtxid,signedtx);
if ( deststate == 0 )
if ( deststate != 0xffffffff )
deststate = dpow_statemachineiterate(myinfo,dp,dest,deststate,desthash.hash,desthash.height,notaries,n,myind,&recvmask,&signedtxid,signedtx);
if ( deststate == 0xffffffff )
{
if ( srcstate != 0xffffffff )
srcstate = dpow_statemachineiterate(myinfo,dp,src,srcstate,srchash.hash,srchash.height,notaries,n,myind,&recvmask,&signedtxid,signedtx);
}
}
free(ptr);
}
@ -756,16 +759,17 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che
void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
{
void **ptrs;
void **ptrs; char str[65]; struct dpow_checkpoint checkpoint;
dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime);
printf("%s srcupdate ht.%d destupdated.%u nonz.%d %llx\n",dp->symbol,height,dp->destupdated,bits256_nonz(dp->srcfifo[dp->srcconfirms].blockhash.hash),(long long)dp->last.blockhash.hash.txid);
checkpoint = dp->srcfifo[dp->srcconfirms];
printf("%s srcupdate ht.%d destupdated.%u nonz.%d %s\n",dp->symbol,height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash));
dpow_fifoupdate(myinfo,dp->srcfifo,dp->last);
if ( dp->destupdated != 0 && bits256_nonz(dp->srcfifo[dp->srcconfirms].blockhash.hash) != 0 )
if ( dp->destupdated != 0 && bits256_nonz(checkpoint.blockhash.hash) != 0 )
{
ptrs = calloc(1,sizeof(void *)*2 + sizeof(struct dpow_checkpoint));
ptrs[0] = (void *)myinfo;
ptrs[1] = (void *)dp;
memcpy(&ptrs[2],&dp->srcfifo[dp->srcconfirms],sizeof(dp->srcfifo[dp->srcconfirms]));
memcpy(&ptrs[2],&checkpoint,sizeof(checkpoint));
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)dpow_statemachinestart,(void *)ptrs) != 0 )
{
}

3
iguana/notaries.h

@ -29,10 +29,11 @@ char *Notaries[][2] =
{ "locomb_EU", "0252c7a960606f53ea562207561b2be1a62bd2801944bb5ac41b5591fe03c7f0e5" },
{ "jeezy_EU", "035e05eca2eb3aab88a6e10c368b9f039cd6f5e02e4e6dc554eb7f552991915280" },
{ "farl4web_EU", "035caa40684ace968677dca3f09098aa02b70e533da32390a7654c626e0cf908e1" },
{ "nxtswe_EU", "0393b7d10b7d723a1e26452a02755f229150e6626423859e1ae69771f1f374d09e" },
{ "nxtswe_EU", "03e54828c23b3eba5ad9324160e75698b1298851c77c88dc094ba23105f69c2415" },
{ "crackers_EU", "024612bc1b43cf67692f243b5acbeb90e1f5704cd2f19c0741207ccc5fb218251e" },
{ "traderbill_EU", "03267254424fb00792b9d5cac7124849b70520e125dc0107946c44aecb9aab50fa" },
{ "vanbreuk_EU", "024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3" },
{ "titomane_EU", "020c909e72415d1abf151b5cbb521c2a1e14a92fb262cdd3237557da804334e1da" },
{ "Server1","0221876c8259764224dc1a7b70ec956f3fbe9a768cd77f13082cfa60eb6aa2d068"},
{ "Server2","03c7c14e6b1f94585bb571cf3ee5eb9b9ab54bd23d0acb8cf13edad1c515842b66"},
{ "Server3","02d28f8992ff0cd68c5d558cf55ec5b3ada25151519a6cea8cef1bac04c40023b6"},

Loading…
Cancel
Save