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)); //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 ) while ( time(NULL) < starttime+bp->duration && src != 0 && dest != 0 && bp->state != 0xffffffff )
{ {
sleep(3);
if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height ) if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height )
{ {
if ( bp->isratify == 0 ) 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; uint8_t data[sizeof(struct dpow_coinentry)*64 + 4096]; bits256 zero; int32_t len = 0;
memset(zero.bytes,0,sizeof(zero)); 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->bestk;
data[len++] = bp->numnotaries; data[len++] = bp->numnotaries;
len += iguana_rwbignum(1,&data[len],sizeof(bp->hashmsg),bp->hashmsg.bytes); 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 // if valid add to pricefeed for issue
printf("WITHDRAW ht.%d txi.%d vout.%d %.8f\n",height,txi,vout,dstr(value)); 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); 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; char *retstr; int32_t i,kmdheight; cJSON *infoobj,*result; uint16_t port = coin->chain->rpcport;
if ( KMDHEIGHT <= 0 ) if ( height <= 0 )
KMDHEIGHT = 1; height = 1;
*KOMODO_REALTIMEp = 0; *isrealtimep = 0;
if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getinfo",0,port)) != 0 ) if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getinfo",0,port)) != 0 )
{ {
if ( (infoobj= cJSON_Parse(retstr)) != 0 ) if ( (infoobj= cJSON_Parse(retstr)) != 0 )
{ {
if ( (result= jobj(infoobj,(char *)"result")) != 0 && (kmdheight= jint(result,(char *)"blocks")) != 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); /*fprintf(stderr,"%s.%d ",coin->symbol,height);
/*if ( (KMDHEIGHT % 10) == 0 ) if ( (height % 10) == 0 )
{ {
if ( (KMDHEIGHT % 100) == 0 ) if ( (height % 100) == 0 )
fprintf(stderr,"%s.%d ",coin->symbol,KMDHEIGHT); fprintf(stderr,"%s.%d ",coin->symbol,height);
memset(&zero,0,sizeof(zero)); 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; break;
} }
usleep(10000); usleep(10000);
} }
if ( KMDHEIGHT >= kmdheight ) if ( height >= kmdheight )
*KOMODO_REALTIMEp = (uint32_t)time(NULL); *isrealtimep = (uint32_t)time(NULL);
} }
free_json(infoobj); free_json(infoobj);
} }
@ -522,6 +523,6 @@ int32_t dpow_issuer_iteration(struct iguana_info *coin,int32_t KMDHEIGHT,uint32_
sleep(3); sleep(3);
} }
//KOMODO_DEPOSIT = komodo_paxtotal(); //KOMODO_DEPOSIT = komodo_paxtotal();
return(KMDHEIGHT); return(height);
} }

Loading…
Cancel
Save