Browse Source

test

etomic
jl777 8 years ago
parent
commit
d89dbe15df
  1. 2
      iguana/dPoW.h
  2. 4
      iguana/dpow/dpow_network.c
  3. 9
      iguana/iguana_notary.c

2
iguana/dPoW.h

@ -134,7 +134,7 @@ struct dpow_info
uint32_t SRCREALTIME,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify;
int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying;
struct pax_transaction *PAX;
portable_mutex_t paxmutex,dpowmutex,dexmutex;
portable_mutex_t paxmutex,dexmutex;
uint32_t ipbits[64],numipbits;
struct dpow_block **blocks;
};

4
iguana/dpow/dpow_network.c

@ -820,7 +820,7 @@ void dpow_nanomsg_update(struct supernet_info *myinfo)
int32_t i,n=0,num=0,size,firstz = -1; uint32_t crc32,r,m; struct dpow_nanomsghdr *np=0; struct dpow_info *dp; struct dpow_block *bp; struct dex_nanomsghdr *dexp = 0;
if ( time(NULL) < myinfo->nanoinit+5 )
return;
portable_mutex_lock(&dp->dpowmutex);
portable_mutex_lock(&myinfo->dpowmutex);
while ( (size= nn_recv(myinfo->dpowsock,&np,NN_MSG,0)) >= 0 )
{
num++;
@ -871,7 +871,7 @@ void dpow_nanomsg_update(struct supernet_info *myinfo)
if ( size == 0 || n++ > 100 )
break;
}
portable_mutex_unlock(&dp->dpowmutex);
portable_mutex_unlock(&myinfo->dpowmutex);
if ( 0 && n != 0 )
printf("nanoupdates.%d\n",n);
n = 0;

9
iguana/iguana_notary.c

@ -297,12 +297,9 @@ TWO_STRINGS(iguana,dpow,symbol,pubkey)
dp->maxblocks = 100000;
dp->blocks = calloc(dp->maxblocks,sizeof(*dp->blocks));
}
if ( myinfo->numdpows++ == 0 )
{
portable_mutex_init(&dp->paxmutex);
portable_mutex_init(&dp->dexmutex);
portable_mutex_init(&dp->dpowmutex);
}
myinfo->numdpows++;
portable_mutex_init(&dp->paxmutex);
portable_mutex_init(&dp->dexmutex);
PAX_init();
//printf(">>>>>>>>>>>>>>> call paxpending\n");
//uint8_t buf[32768];

Loading…
Cancel
Save