From e08a50ce9df73b4a6304fe9492695a4ab19877e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Jan 2017 19:47:37 +0200 Subject: [PATCH] fix syncing notary chain second+ times --- iguana/dpow/dpow_network.c | 2 +- iguana/iguana777.h | 2 +- iguana/iguana_init.c | 3 ++- iguana/iguana_recv.c | 6 ++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 671068bf4..2e3d5b85e 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -80,7 +80,7 @@ NN_CONNECT to (tcp://27.50.93.252:7775)*/ void dex_init(struct supernet_info *myinfo) { - int32_t i,j,mask = 0; char *seeds[] = { "78.47.196.146", "149.56.29.163", "191.235.80.138", "94.102.63.226", "129.232.225.202", "104.255.64.3", "52.72.135.200" }; + int32_t i,j,mask = 0; char *seeds[] = { "78.47.196.146", "5.9.102.210", "149.56.29.163", "191.235.80.138", "88.198.65.74", "94.102.63.226", "129.232.225.202", "104.255.64.3", "52.72.135.200", "149.56.28.84", "103.18.58.150", "221.121.144.140", "123.249.79.12", "103.18.58.146" }; OS_randombytes((void *)&i,sizeof(i)); srand(i); for (i=0; idexseed_ipaddrs)/sizeof(*myinfo->dexseed_ipaddrs); i++) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index e394157b2..258e42c90 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -131,7 +131,7 @@ struct supernet_info struct liquidity_info linfos[512]; struct komodo_notaries NOTARY; char seedipaddr[64]; uint32_t dpowipbits[128]; int32_t numdpowipbits; portable_mutex_t notarymutex,dpowmutex; - char dexseed_ipaddrs[1][64]; uint32_t dexipbits[128]; int32_t numdexipbits; portable_mutex_t dexmutex; + char dexseed_ipaddrs[4][64]; uint32_t dexipbits[128]; int32_t numdexipbits; portable_mutex_t dexmutex; // compatibility bits256 pangea_category,instantdex_category; uint8_t logs[256],exps[510]; diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index 9432c99df..d5474a30e 100755 --- a/iguana/iguana_init.c +++ b/iguana/iguana_init.c @@ -599,7 +599,7 @@ struct iguana_info *iguana_coinstart(struct supernet_info *myinfo,struct iguana_ } } } - if ( (coin->notarychain= iguana_isnotarychain(coin->symbol)) >= 0 ) + if ( (coin->notarychain= iguana_isnotarychain(coin->symbol)) >= 0 && coin->FULLNODE == 0 ) { printf("SET %s NOTARYCHAIN.%d\n",coin->symbol,coin->notarychain); return(coin); @@ -665,6 +665,7 @@ struct iguana_info *iguana_coinstart(struct supernet_info *myinfo,struct iguana_ //sprintf(fname,"confs/%s_%s.txt",coin->symbol,(iter == 0) ? "peers" : "hdrs"); //sprintf(fname,"tmp/%s/%s.txt",coin->symbol,(iter == 0) ? "peers" : "hdrs"); OS_compatible_path(fname); + printf("check.(%s)\n",fname); if ( (fp= fopen(fname,"r")) != 0 ) { if ( coin->virtualchain == 0 || iter > 0 ) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index d64beb07f..8a318fb58 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -1301,10 +1301,12 @@ struct iguana_bundle *iguana_bundleset(struct supernet_info *myinfo,struct iguan { if (prevbp->hdrsi + 1 == coin->bundlescount && prevbundlei == coin->chain->bundlesize - 1) { + if ( (prevbp->hdrsi % 10) == 9 ) + iguana_savehdrs(coin); printf("%s AUTOCREATE.%d\n", coin->symbol, prevbp->bundleheight + coin->chain->bundlesize); - if ((bp = iguana_bundlecreate(coin, bundleip, prevbp->bundleheight + coin->chain->bundlesize, hash2, zero, 0)) != 0) + if ( (bp= iguana_bundlecreate(coin, bundleip, prevbp->bundleheight + coin->chain->bundlesize, hash2, zero, 0)) != 0) { - if (bp->queued == 0) + if ( bp->queued == 0 ) iguana_bundleQ(myinfo, coin, bp, 1000); } }