From b5c159b5b4f7e4e977292c81f67d19223bce4c45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 8 Oct 2018 05:45:00 -1100 Subject: [PATCH 1/3] Netid default seednodes --- iguana/exchanges/LP_nativeDEX.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 438767e08..ec978a063 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1055,7 +1055,10 @@ void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint } if ( (netid > 0 && netid < 9) && (seednode == 0 || seednode[0] == 0) ) { - sprintf(fixedseed,"5.9.253.%d",195 + netid); + if ( (netid & 1) != 0 ) + strcpy(fixedseed,"46.4.78.11"); + else strcpy(fixedseed,"46.4.87.18"); + //sprintf(fixedseed,"5.9.253.%d",195 + netid); seednode = fixedseed; } if ( seednode == 0 || seednode[0] == 0 ) From 304a5dd39178cf07cc5eae70369d5f3216c1d5fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 8 Oct 2018 07:39:36 -1100 Subject: [PATCH 2/3] Prints --- iguana/dpow/dpow_fsm.c | 6 +++--- iguana/dpow/dpow_tx.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index bdfc579d6..1507d384f 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -265,7 +265,7 @@ void dpow_statemachinestart(void *ptr) void **ptrs = ptr; struct supernet_info *myinfo; struct dpow_info *dp; struct dpow_checkpoint checkpoint; int32_t i,j,ht,extralen,destprevvout0,srcprevvout0,src_or_dest,numratified=0,kmdheight,myind = -1; uint8_t extras[10000],pubkeys[64][33]; cJSON *ratified=0,*item; struct iguana_info *src,*dest; char *jsonstr,*handle,*hexstr,str[65],str2[65],srcaddr[64],destaddr[64]; bits256 zero,MoM,merkleroot,srchash,destprevtxid0,srcprevtxid0; struct dpow_block *bp; struct dpow_entry *ep = 0; uint32_t MoMdepth,duration,minsigs,starttime,srctime; - char *destlockunspent,*srclockunspent,*destunlockunspent,*srcunlockunspent; + char *destlockunspent=0,*srclockunspent=0,*destunlockunspent=0,*srcunlockunspent=0; memset(&zero,0,sizeof(zero)); MoM = zero; srcprevtxid0 = destprevtxid0 = zero; @@ -519,7 +519,7 @@ void dpow_statemachinestart(void *ptr) free(destlockunspent); } - if ( strcmp("BTC",dest->symbol) == 0 ) + if ( 0 && strcmp("BTC",dest->symbol) == 0 ) { // lock the src coin selected utxo if the source coin is KMD. srclockunspent = dpow_lockunspent(myinfo,bp->srccoin,srcaddr,bits256_str(str2,ep->src.prev_hash),ep->src.prev_vout); @@ -634,7 +634,7 @@ void dpow_statemachinestart(void *ptr) } // unlock the src selected utxo on KMD, as those are the only ones we LOCK, and CHIPS does not like the lockunspent call. - if ( strcmp("BTC",dest->symbol) == 0 ) + if ( 0 && strcmp("BTC",dest->symbol) == 0 ) { srcunlockunspent = dpow_unlockunspent(myinfo,bp->srccoin,srcaddr,bits256_str(str2,ep->src.prev_hash),ep->src.prev_vout); if (strncmp(srcunlockunspent,"true", 4) == 0 ) diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index 51ba39f8b..148827d68 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -615,7 +615,7 @@ void dpow_sigscheck(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo else { bp->state = 0xffffffff; - printf("dpow_sigscheck: mismatched txid.%s vs %s\n",bits256_str(str,txid),retstr); + printf("dpow_sigscheck.(%s): mismatched txid.%s vs %s\n",bp->signedtx,bits256_str(str,txid),retstr); } free(retstr); retstr = 0; From d7b95398cae5ec5ecbbba9cc169ef4eb24b16fb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 8 Oct 2018 07:51:10 -1100 Subject: [PATCH 3/3] DPOW_MAXIPBITS --- iguana/dPoW.h | 4 +++- iguana/dpow/dpow_network.c | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index bc343f144..a4eddca76 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -135,6 +135,8 @@ struct pax_transaction char symbol[16],coinaddr[64]; uint8_t rmd160[20],shortflag; }; +#define DPOW_MAXIPBITS 512 + struct dpow_info { char symbol[16],dest[16]; uint8_t minerkey33[33],minerid; uint64_t lastrecvmask; @@ -146,7 +148,7 @@ struct dpow_info struct pax_transaction *PAX; uint32_t fullCCid; portable_mutex_t paxmutex,dexmutex; - uint32_t ipbits[128],numipbits; + uint32_t ipbits[DPOW_MAXIPBITS],numipbits; struct dpow_block **blocks,*currentbp; }; diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index c6d3db7d5..dcde57514 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -481,7 +481,7 @@ char *_dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *key,int32 for (i=0; idexipbits[i] ) break; - if ( i == n && n < 64 ) + if ( i == n && n < DPOW_MAXIPBITS ) { myinfo->dexipbits[n++] = ipbits; qsort(myinfo->dexipbits,n,sizeof(uint32_t),_increasing_ipbits); @@ -1292,7 +1292,7 @@ struct dpow_nanomsghdr { bits256 srchash,desthash; struct dpow_nanoutxo ratify,notarize; - uint32_t channel,height,size,datalen,crc32,myipbits,numipbits,ipbits[128]; + uint32_t channel,height,size,datalen,crc32,myipbits,numipbits,ipbits[DPOW_MAXIPBITS]; char symbol[16]; uint8_t senderind,version0,version1,packet[]; } PACKED; @@ -1363,15 +1363,15 @@ int32_t dpow_addnotary(struct supernet_info *myinfo,struct dpow_info *dp,char *i { char str[512]; uint32_t ipbits,*ptr; int32_t i,iter,n,retval = -1; - #ifdef CHECKNODEIP +#ifdef CHECKNODEIP // -B- [+] Decker --- - static uint32_t list_ipbits[128]; - static int dead_or_alive[128]; // 0 - not set, -1 - dead, 1 - alive + static uint32_t list_ipbits[DPOW_MAXIPBITS]; + static int dead_or_alive[DPOW_MAXIPBITS]; // 0 - not set, -1 - dead, 1 - alive static int list_ipsize; int in_list_flag; uint32_t ip_pattern; // -E- [+] Decker --- - #endif +#endif if ( myinfo->IAMNOTARY == 0 ) return(-1); @@ -1382,8 +1382,8 @@ int32_t dpow_addnotary(struct supernet_info *myinfo,struct dpow_info *dp,char *i // -B- [+] Decker --- // every new ip in BUS topology network goes to dead or white list forever, until iguana restart ip_pattern = (uint32_t)calc_ipbits(ipaddr); - if ((list_ipsize == 0) || (list_ipsize > 127)) { - for (int i_list = 0; i_list < 128; i_list++) { list_ipbits[i_list] = 0; dead_or_alive[i_list] = 0; } + if ((list_ipsize == 0) || (list_ipsize > DPOW_MAXIPBITS-1)) { + for (int i_list = 0; i_list < DPOW_MAXIPBITS; i_list++) { list_ipbits[i_list] = 0; dead_or_alive[i_list] = 0; } list_ipsize = 0; in_list_flag = -1; } else { @@ -1426,7 +1426,7 @@ int32_t dpow_addnotary(struct supernet_info *myinfo,struct dpow_info *dp,char *i for (i=0; iipaddr) != 0 )