From a08f121c56b99d99c73e218f6a4aceb278049563 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Apr 2016 19:52:42 -0500 Subject: [PATCH] test --- iguana/confs/BTCD_hdrs.h | 2 -- iguana/iguana_bundles.c | 8 +------- iguana/iguana_recv.c | 4 ++-- iguana/iguana_unspents.c | 4 ++-- iguana/main.c | 4 ++-- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/iguana/confs/BTCD_hdrs.h b/iguana/confs/BTCD_hdrs.h index 5d1bde8c5..591a99b77 100644 --- a/iguana/confs/BTCD_hdrs.h +++ b/iguana/confs/BTCD_hdrs.h @@ -2115,6 +2115,4 @@ char *BTCD_hdrs[][4] = { { "1056500", "4f7ce26131a4923137977f716334a07a99d1fede466564c89aac75415eea0eb3", "6723f6345fe576dcac1c5ccb5390321e317408c7dc34c4ddca7a6ac83c577ca1", "1649fcd866bf63938016938d91a53248bf9a50db3fe7af3711beec8fc3ac573f"}, { "1057000", "1fbe16214e11324f46064f3754e3189dc4e57e9aafe221ea7fa45627f0db2f2d", "123d5e7d330c6dc7cf7a4b9efc6375736de9b6acd14e75205e72513a19e938de", "c7dc8a859791fb06bc5de694f4586affa038b1b065ceb3abec61ef4e27dd3c3f"}, { "1057500", "2c742e483d8a978656e28a4b574fcac3264f040a569e8e141fb3b5f0de9585c7", "301d401df39b752d5e5a7c3d11b8dc6f985b7f836a4f8e4a318631c45d6d4f6f", "eb5eea8f78367516258e9e79be1c491b84899dbd73b9469c862b115088f44e89"}, -{ "1058000", "71060b474bbc2cccca3629b7a682061d4c6883c35750878c998c2946f99fc70e", "e853025a32604033563ba0534f00dfaa3a7b7ab8a58ba1ff273f5171b8b0b467", "72afdeb47d0f75352b8986ec6b7c7a8a4527a72fc245f7469a6f12df141a2ec4"}, -{ "1058500", "86d1e3325a942cdad7e74813a1d548d16aa30477ade1436b839e5d8787886226", "", ""}, }; diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 586a89917..13bd43915 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -240,13 +240,7 @@ int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blo if ( (block->hdrsi != bp->hdrsi || block->bundlei != bundlei) && (block->hdrsi != 0 || block->bundlei != 0) ) { char str[65]; printf("blockadd warning: %d[%d] main.%d <- %d[%d] %s\n",block->hdrsi,block->bundlei,block->mainchain,bp->hdrsi,bundlei,bits256_str(str,hash2)); - if ( block->mainchain != 0 ) - { - memset(bp->hashes[bundlei].bytes,0,sizeof(bp->hashes[bundlei])); - if ( bp->speculative != 0 ) - bp->speculative[bundlei] = bp->hashes[bundlei]; - bp->blocks[bundlei] = 0; - } + iguana_blockunmark(coin,block,bp,bundlei,block->mainchain != 0); err |= 2; return(-1); //exit(-1); diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 907447474..a799545b3 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -227,7 +227,7 @@ int32_t iguana_speculativefind(struct iguana_info *coin,struct iguana_bundle *bp continue; } if ( memcmp(&recvlen,tmp,sizeof(recvlen)) != 0 || memcmp(&tmp[sizeof(recvlen)],data,recvlen) != 0 ) - printf("data ERROR [%d:%d] already has recvlen.%d for %s\n",bp->hdrsi,i,recvlen,bits256_str(str,block->RO.hash2)); + printf("cachedata ERROR [%d:%d] already has recvlen.%d vs %d for %s\n",bp->hdrsi,i,recvlen,cachelen,bits256_str(str,block->RO.hash2)); return(0); } bp->speculativecache[i] = calloc(1,recvlen + sizeof(recvlen)); @@ -887,7 +887,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct iguana_blockQ("recvhash1",coin,0,-1,bp->nextbundlehash2,1); } //printf("call allhashes\n"); - if ( bp->hdrsi == coin->bundlescount-1 ) + if ( 0 && bp->hdrsi == coin->bundlescount-1 ) iguana_autoextend(coin,bp); if ( iguana_allhashcmp(coin,bp,blockhashes,num) > 0 ) return(req); diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 1009f96c2..304c3e797 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -222,7 +222,7 @@ int32_t iguana_volatilesmap(struct iguana_info *coin,struct iguana_ramchain *ram } else { - printf("ramchain.[%d] map error balanceswritten %d vs %d hashes %x %x\n",ramchain->H.data->height,coin->balanceswritten,numhdrsi,coin->balancehash.uints[0],balancehash.uints[0]); + //printf("ramchain.[%d] map error balanceswritten %d vs %d hashes %x %x\n",ramchain->H.data->height,coin->balanceswritten,numhdrsi,coin->balancehash.uints[0],balancehash.uints[0]); err++; OS_removefile(fname,0); } @@ -888,7 +888,7 @@ uint32_t iguana_spendvectorconv(struct iguana_info *coin,struct iguana_spendvect int32_t iguana_spendvectorsave(struct iguana_info *coin,struct iguana_bundle *bp,struct iguana_ramchain *ramchain,struct iguana_spendvector *ptr,int32_t emit,int32_t n) { int32_t i,retval = -1; FILE *fp; char fname[1024],str[65]; long fsize; bits256 zero,sha256; - if ( ptr == bp->ramchain.Xspendinds ) + if ( ptr == 0 || (bp->hdrsi != 0 && ptr == bp->ramchain.Xspendinds) ) { //printf("iguana_spendvectorsave.[%d] ptr.%p Xspendinds\n",bp->hdrsi,ptr); return(0); diff --git a/iguana/main.c b/iguana/main.c index 92ef518ab..6262da06b 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -1139,7 +1139,7 @@ void iguana_appletests(struct supernet_info *myinfo) exit(-1); } sleep(1);*/ - if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"prefetchlag\":13,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":500,\"endpend\":500,\"services\":129,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) + if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"prefetchlag\":13,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":500,\"endpend\":500,\"services\":128,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) { free(str); if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0,myinfo->rpcport)) != 0 ) @@ -1327,7 +1327,7 @@ void iguana_main(void *arg) iguana_helpinit(myinfo); iguana_commandline(myinfo,arg); #ifdef __APPLE__ - //iguana_appletests(myinfo); + iguana_appletests(myinfo); #endif iguana_launchdaemons(myinfo); }