Browse Source

Merge pull request #190 from fadedreamz/dev

updated compilation for windows, added bugfix for parallel sync on windows
etomic
jl777 8 years ago
committed by GitHub
parent
commit
f93dd017d0
  1. 9
      basilisk/tradebots_SVM.h
  2. 52
      iguana/iguana_recv.c

9
basilisk/tradebots_SVM.h

@ -20,7 +20,16 @@
//#include <dispatch/dispatch.h> //#include <dispatch/dispatch.h>
typedef float svmtype; typedef float svmtype;
#ifdef WIN32
// fadedreamz@gmail.com - added for successful compilation, however, for MSVC probably require a particular OpenCL SDK
// to work with it (e,g nvidia or amd SDK)
typedef struct fake_opencl_double {
double x;
double y;
}double2;
#else
typedef double double2 __attribute__((ext_vector_type(2))); typedef double double2 __attribute__((ext_vector_type(2)));
#endif
#define MAX_VECTORS (1440 * 365 * 5) #define MAX_VECTORS (1440 * 365 * 5)
#define MAIN_MAXCORES 16 #define MAIN_MAXCORES 16
#define c_to_refc(c) (c) #define c_to_refc(c) (c)

52
iguana/iguana_recv.c

@ -1291,31 +1291,33 @@ struct iguana_bundle *iguana_bundleset(struct supernet_info *myinfo,struct iguan
iguana_bundlespeculate(coin,bp,bundlei,hash2,1); iguana_bundlespeculate(coin,bp,bundlei,hash2,1);
} }
prevbp = 0, prevbundlei = -2; prevbp = 0, prevbundlei = -2;
iguana_bundlefind(coin,&prevbp,&prevbundlei,prevhash2); if (bits256_nonz(prevhash2)) {
//if ( 0 && block->blockhashes != 0 ) iguana_bundlefind(coin, &prevbp, &prevbundlei, prevhash2);
// fprintf(stderr,"has blockhashes bp.%p[%d] prevbp.%p[%d]\n",bp,bundlei,prevbp,prevbundlei); //if ( 0 && block->blockhashes != 0 )
if ( prevbp != 0 && prevbundlei >= 0 && (prevblock= iguana_blockfind("bundleset2",coin,prevhash2)) != 0 ) // fprintf(stderr,"has blockhashes bp.%p[%d] prevbp.%p[%d]\n",bp,bundlei,prevbp,prevbundlei);
{ if (prevbp != 0 && prevbundlei >= 0 && (prevblock = iguana_blockfind("bundleset2", coin, prevhash2)) != 0)
if ( prevbundlei < coin->chain->bundlesize ) {
{ if (prevbundlei < coin->chain->bundlesize)
if ( prevbp->hdrsi+1 == coin->bundlescount && prevbundlei == coin->chain->bundlesize-1 ) {
{ if (prevbp->hdrsi + 1 == coin->bundlescount && prevbundlei == coin->chain->bundlesize - 1)
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 ) 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->queued == 0 ) {
iguana_bundleQ(myinfo,coin,bp,1000); if (bp->queued == 0)
} iguana_bundleQ(myinfo, coin, bp, 1000);
} }
if ( prevbundlei < coin->chain->bundlesize-1 ) }
{ if (prevbundlei < coin->chain->bundlesize - 1)
//printf("bundlehash2add next %d\n",prevbundlei); {
iguana_bundlehash2add(coin,0,prevbp,prevbundlei+1,hash2); //printf("bundlehash2add next %d\n",prevbundlei);
} iguana_bundlehash2add(coin, 0, prevbp, prevbundlei + 1, hash2);
if ( 1 && strcmp("BTC",coin->symbol) != 0 ) }
iguana_bundlespeculate(coin,prevbp,prevbundlei,prevhash2,2); if (1 && strcmp("BTC", coin->symbol) != 0)
} iguana_bundlespeculate(coin, prevbp, prevbundlei, prevhash2, 2);
} }
}
}
} else printf("iguana_bundleset: error adding blockhash\n"); } else printf("iguana_bundleset: error adding blockhash\n");
bp = 0, *bundleip = -2; bp = 0, *bundleip = -2;
return(iguana_bundlefind(coin,&bp,bundleip,hash2)); return(iguana_bundlefind(coin,&bp,bundleip,hash2));

Loading…
Cancel
Save