From 3365f14d7bab045502f23fa19d655d3b5851b97b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Sep 2016 14:38:40 -0300 Subject: [PATCH 1/7] test --- iguana/iguana_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 3fc081107..4f84ce324 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -105,8 +105,8 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, { if ( (rand() % 10000) == 0 ) printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind); - iguana_send_version(coin,addr,coin->myservices); - //return(-1); + //iguana_send_version(coin,addr,coin->myservices); + return(-1); } lastreq2 = lastreq; lastreq = hash2; From 474155a2a15a03278d15d06c828784d50e6e2399 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Sep 2016 14:46:55 -0300 Subject: [PATCH 2/7] test --- iguana/iguana_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 4f84ce324..447d9df64 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -80,7 +80,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, checkbp = 0, j = -2; if ( (checkbp= iguana_bundlefind(coin,&checkbp,&j,hash2)) != 0 && j >= 0 && j < checkbp->n && checkbp != coin->current ) { - if ( checkbp->emitfinish != 0 || ((block= checkbp->blocks[j]) != 0 && block->txvalid != 0 && block->mainchain != 0 && block->valid != 0 && block->bundlei != 0 && coin->RTheight == 0) ) + if ( checkbp->utxofinish != 0 || ((block= checkbp->blocks[j]) != 0 && block->txvalid != 0 && block->mainchain != 0 && block->valid != 0 && block->bundlei != 0 && coin->RTheight == 0) ) return(0); } if ( checkbp != bp || j != bundlei ) @@ -127,7 +127,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, iguana_send(coin,addr,serialized,len); if ( block != 0 ) block->issued = addr->pendtime; - if ( 0 && coin->current == bp ) + if ( coin->current == bp ) printf("REQ.(%s) [%d:%d] %s n.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1,addr->ipaddr,addr->pendblocks); } else printf("MSG_BLOCK null datalen.%d\n",len); return(len); From 5ed1ec183d9301e376f89ec348cbc4e2d27dd351 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Sep 2016 14:52:29 -0300 Subject: [PATCH 3/7] test --- iguana/iguana_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 447d9df64..35ad1d725 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -1238,7 +1238,7 @@ struct iguana_bundle *iguana_bundleset(struct supernet_info *myinfo,struct iguan bundlei = ((mainchain->height+i) % coin->chain->bundlesize); if ( hdrsi < coin->bundlescount && (bp= coin->bundles[hdrsi]) != 0 ) { - if ( (tmp= bp->blocks[hdrsi]) != 0 && tmp->height == mainchain->height+i ) + if ( (tmp= bp->blocks[bundlei]) != 0 && tmp->height == mainchain->height+i ) { iguana_bundle_set(coin,tmp,mainchain->height+i); iguana_RTnewblock(myinfo,coin,tmp); From cd2f262cd3c085783f0466d89874c4521721ba8d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Sep 2016 14:59:10 -0300 Subject: [PATCH 4/7] test --- iguana/iguana_recv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 35ad1d725..adf0ffb10 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -127,7 +127,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, iguana_send(coin,addr,serialized,len); if ( block != 0 ) block->issued = addr->pendtime; - if ( coin->current == bp ) + if ( 0 && coin->current == bp ) printf("REQ.(%s) [%d:%d] %s n.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1,addr->ipaddr,addr->pendblocks); } else printf("MSG_BLOCK null datalen.%d\n",len); return(len); @@ -740,6 +740,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru printf("got block that doesnt validate? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); return; } + printf("getblockM %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); iguana_peer_meminit(coin,addr); if ( iguana_txmerkle(coin,addr->TXDATA.ptr,(int32_t)addr->TXDATA.totalsize,origtxdata,txarray) < 0 ) return; From ab2463777c43c6321e037a2cb759ab513e706dac Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Sep 2016 15:02:07 -0300 Subject: [PATCH 5/7] test --- iguana/iguana_recv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index adf0ffb10..4096ef466 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -751,7 +751,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru bp = 0, bundlei = -2; if ( iguana_bundlefind(coin,&bp,&bundlei,origtxdata->zblock.RO.prev_block) == 0 ) { - //printf("gotblockM: RTblock? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); + printf("gotblockM: RTblock? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); numtx = origtxdata->zblock.RO.txn_count; iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx); req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); @@ -792,7 +792,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru { req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); - //printf("negative speculative return %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); + printf("negative speculative return %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); return; } /*if ( block == 0 ) @@ -813,7 +813,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru } numtx = origtxdata->zblock.RO.txn_count; iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx); - if ( 0 && bp == coin->current ) + //if ( 0 && bp == coin->current ) printf("getblockM update [%d:%d] %s %p\n",bp->hdrsi,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2),block); if ( block != 0 ) { From d533a2941505ee183f5d894482beeb90ecd77dff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Sep 2016 15:05:44 -0300 Subject: [PATCH 6/7] test --- iguana/iguana_recv.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 4096ef466..de659207b 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -740,7 +740,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru printf("got block that doesnt validate? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); return; } - printf("getblockM %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); + //printf("getblockM %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); iguana_peer_meminit(coin,addr); if ( iguana_txmerkle(coin,addr->TXDATA.ptr,(int32_t)addr->TXDATA.totalsize,origtxdata,txarray) < 0 ) return; @@ -795,13 +795,17 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru printf("negative speculative return %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); return; } - /*if ( block == 0 ) - block = iguana_blockhashset("noblock",coin,bp->bundleheight+bundlei,origtxdata->zblock.RO.hash2,1); - if ( block->hdrsi != bp->hdrsi || block->bundlei != bundlei ) + if ( bp == coin->current ) { - block->hdrsi = bp->hdrsi; - block->bundlei = bundlei; - }*/ + if ( block == 0 ) + block = iguana_blockhashset("noblock",coin,bp->bundleheight+bundlei,origtxdata->zblock.RO.hash2,1); + if ( block->hdrsi != bp->hdrsi || block->bundlei != bundlei ) + { + block->hdrsi = bp->hdrsi; + block->bundlei = bundlei; + } + printf("getblockM update [%d:%d] %s %p\n",bp->hdrsi,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2),block); + } if ( (block= bp->blocks[bundlei]) == 0 || bits256_nonz(bp->hashes[bundlei]) == 0 ) { //printf("SET [%d:%d]\n",bp->hdrsi,bundlei); @@ -813,8 +817,6 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru } numtx = origtxdata->zblock.RO.txn_count; iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx); - //if ( 0 && bp == coin->current ) - printf("getblockM update [%d:%d] %s %p\n",bp->hdrsi,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2),block); if ( block != 0 ) { if ( block->height < 0 ) From 842022215e517aa52b2fb186cf774c71ae6875a3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Sep 2016 15:08:42 -0300 Subject: [PATCH 7/7] test --- iguana/iguana_recv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index de659207b..9861af3df 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -751,7 +751,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru bp = 0, bundlei = -2; if ( iguana_bundlefind(coin,&bp,&bundlei,origtxdata->zblock.RO.prev_block) == 0 ) { - printf("gotblockM: RTblock? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); + //printf("gotblockM: RTblock? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); numtx = origtxdata->zblock.RO.txn_count; iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx); req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); @@ -792,7 +792,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru { req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); - printf("negative speculative return %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); + //printf("negative speculative return %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); return; } if ( bp == coin->current ) @@ -804,7 +804,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru block->hdrsi = bp->hdrsi; block->bundlei = bundlei; } - printf("getblockM update [%d:%d] %s %p\n",bp->hdrsi,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2),block); + //printf("getblockM update [%d:%d] %s %p\n",bp->hdrsi,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2),block); } if ( (block= bp->blocks[bundlei]) == 0 || bits256_nonz(bp->hashes[bundlei]) == 0 ) {