jl777 8 years ago
parent
commit
59d569dabe
  1. 4
      iguana/dpow/dpow_network.c
  2. 2
      iguana/iguana777.h
  3. 1
      iguana/main.c

4
iguana/dpow/dpow_network.c

@ -48,6 +48,7 @@ int32_t dpow_addnotary(struct supernet_info *myinfo,char *ipaddr)
char str[512]; uint32_t ipbits; int32_t i,n,retval = -1;
if ( myinfo->dpowsock >= 0 && strcmp(ipaddr,myinfo->ipaddr) != 0 )
{
portable_mutex_lock(myinfo->dpowmutex);
n = myinfo->numdpowipbits;
ipbits = (uint32_t)calc_ipbits(ipaddr);
for (i=0; i<n; i++)
@ -61,6 +62,7 @@ int32_t dpow_addnotary(struct supernet_info *myinfo,char *ipaddr)
printf("addnotary.[%d] (%s) retval.%d\n",n,ipaddr,retval);
myinfo->numdpowipbits++;
}
portable_mutex_unlock(myinfo->dpowmutex);
}
return(retval);
}
@ -142,7 +144,6 @@ void dpow_ipbitsadd(struct supernet_info *myinfo,uint32_t *ipbits,int32_t numipb
if ( numipbits < 1 )
return;
n = myinfo->numdpowipbits;
printf("recv numipbits.%d numdpowipbits.%d\n",numipbits,n);
matched = missing = 0;
for (i=0; i<numipbits; i++)
{
@ -156,6 +157,7 @@ void dpow_ipbitsadd(struct supernet_info *myinfo,uint32_t *ipbits,int32_t numipb
if ( j == n )
missing++;
}
printf("recv numipbits.%d numdpowipbits.%d matched.%d missing.%d\n",numipbits,n,matched,missing);
if ( (numipbits == 1 || missing < matched) && missing > 0 )
{
for (i=0; i<numipbits; i++)

2
iguana/iguana777.h

@ -103,7 +103,7 @@ struct supernet_info
void *PAXDATA;
struct liquidity_info linfos[64];
struct komodo_notaries NOTARY;
char seedipaddr[64]; uint32_t dpowipbits[128]; int32_t numdpowipbits;
char seedipaddr[64]; uint32_t dpowipbits[128]; int32_t numdpowipbits; portable_mutex_t dpowmutex;
// compatibility
bits256 pangea_category,instantdex_category;
uint8_t logs[256],exps[510];

1
iguana/main.c

@ -1611,6 +1611,7 @@ void iguana_main(void *arg)
}
strcpy(myinfo->rpcsymbol,"BTCD");
iguana_urlinit(myinfo,ismainnet,usessl);
portable_mutex_init(&myinfo->dpowmutex);
if ( myinfo->IAMNOTARY == 0 )
{
#if LIQUIDITY_PROVIDER

Loading…
Cancel
Save