jl777 8 years ago
parent
commit
4437f35f18
  1. 1
      iguana/dpow/dpow_fsm.c
  2. 2
      iguana/dpow/dpow_network.c
  3. 31
      iguana/dpow/dpow_rpc.c

1
iguana/dpow/dpow_fsm.c

@ -609,6 +609,7 @@ void dpow_statemachinestart(void *ptr)
//printf("done utxosync start.%u %u\n",starttime,(uint32_t)time(NULL));
while ( time(NULL) < starttime+bp->duration && src != 0 && dest != 0 && bp->state != 0xffffffff )
{
sleep(3);
if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height )
{
if ( bp->isratify == 0 )

2
iguana/dpow/dpow_network.c

@ -197,7 +197,7 @@ int32_t dpow_sendcoinentrys(struct supernet_info *myinfo,struct dpow_info *dp,st
{
uint8_t data[sizeof(struct dpow_coinentry)*64 + 4096]; bits256 zero; int32_t len = 0;
memset(zero.bytes,0,sizeof(zero));
printf("ht.%d >>>>>>>>>>>>> dpow_sendcoinentrys (%d %llx) <- %llx\n",bp->height,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask);
//printf("ht.%d >>>>>>>>>>>>> dpow_sendcoinentrys (%d %llx) <- %llx\n",bp->height,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask);
data[len++] = bp->bestk;
data[len++] = bp->numnotaries;
len += iguana_rwbignum(1,&data[len],sizeof(bp->hashmsg),bp->hashmsg.bytes);

31
iguana/dpow/dpow_rpc.c

@ -397,6 +397,7 @@ void dpow_issuer_voutupdate(char *symbol,int32_t isspecial,int32_t height,int32_
{
// if valid add to pricefeed for issue
printf("WITHDRAW ht.%d txi.%d vout.%d %.8f\n",height,txi,vout,dstr(value));
// PAX_fiat verify
}
}
}
@ -479,37 +480,37 @@ int32_t dpow_issuer_block(struct iguana_info *coin,int32_t height,uint16_t port)
return(retval);
}
int32_t dpow_issuer_iteration(struct iguana_info *coin,int32_t KMDHEIGHT,uint32_t *KOMODO_REALTIMEp)
int32_t dpow_issuer_iteration(struct iguana_info *coin,int32_t height,uint32_t *isrealtimep)
{
char *retstr; int32_t i,kmdheight; cJSON *infoobj,*result; uint16_t port = coin->chain->rpcport;
if ( KMDHEIGHT <= 0 )
KMDHEIGHT = 1;
*KOMODO_REALTIMEp = 0;
if ( height <= 0 )
height = 1;
*isrealtimep = 0;
if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getinfo",0,port)) != 0 )
{
if ( (infoobj= cJSON_Parse(retstr)) != 0 )
{
if ( (result= jobj(infoobj,(char *)"result")) != 0 && (kmdheight= jint(result,(char *)"blocks")) != 0 )
{
for (i=0; i<1000 && KMDHEIGHT<=kmdheight; i++,KMDHEIGHT++)
for (i=0; i<1000 && height<=kmdheight; i++,height++)
{
fprintf(stderr,"%s.%d ",coin->symbol,KMDHEIGHT);
/*if ( (KMDHEIGHT % 10) == 0 )
/*fprintf(stderr,"%s.%d ",coin->symbol,height);
if ( (height % 10) == 0 )
{
if ( (KMDHEIGHT % 100) == 0 )
fprintf(stderr,"%s.%d ",coin->symbol,KMDHEIGHT);
if ( (height % 100) == 0 )
fprintf(stderr,"%s.%d ",coin->symbol,height);
memset(&zero,0,sizeof(zero));
komodo_stateupdate(KMDHEIGHT,0,0,0,zero,0,0,0,0,KMDHEIGHT,0,0,0,0);
komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,0,0,0,0);
}*/
if ( dpow_issuer_block(coin,KMDHEIGHT,port) < 0 )
if ( dpow_issuer_block(coin,height,port) < 0 )
{
printf("error KMDHEIGHT %d\n",KMDHEIGHT);
printf("error height %d\n",height);
break;
}
usleep(10000);
}
if ( KMDHEIGHT >= kmdheight )
*KOMODO_REALTIMEp = (uint32_t)time(NULL);
if ( height >= kmdheight )
*isrealtimep = (uint32_t)time(NULL);
}
free_json(infoobj);
}
@ -522,6 +523,6 @@ int32_t dpow_issuer_iteration(struct iguana_info *coin,int32_t KMDHEIGHT,uint32_
sleep(3);
}
//KOMODO_DEPOSIT = komodo_paxtotal();
return(KMDHEIGHT);
return(height);
}

Loading…
Cancel
Save