Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
90120db825
  1. 15
      basilisk/basilisk_bitcoin.c
  2. 1
      iguana/iguana777.h
  3. 10
      iguana/iguana_blocks.c
  4. 3
      iguana/iguana_bundles.c

15
basilisk/basilisk_bitcoin.c

@ -92,6 +92,21 @@ char *bitcoin_blockhashstr(char *coinstr,char *serverport,char *userpass,int32_t
return(blockhashstr);
}
bits256 basilisk_blockhash(struct iguana_info *coin,int32_t height)
{
char *blockhashstr; bits256 hash2;
memset(hash2.bytes,0,sizeof(hash2));
if ( coin->MAXPEERS == 1 )
{
if ( (blockhashstr= bitcoin_blockhashstr(coin->symbol,coin->chain->serverport,coin->chain->userpass,height)) != 0 )
{
hash2 = bits256_conv(blockhashstr);
free(blockhashstr);
}
}
return(hash2);
}
cJSON *bitcoin_blockjson(int32_t *heightp,char *coinstr,char *serverport,char *userpass,char *blockhashstr,int32_t height)
{
cJSON *json = 0; int32_t flag = 0; char buf[1024],*blocktxt = 0;

1
iguana/iguana777.h

@ -1015,6 +1015,7 @@ void basilisk_functions(struct iguana_info *coin);
char *bitcoind_passthru(char *coinstr,char *serverport,char *userpass,char *method,char *params);
char *bitcoin_calcrawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJSON **vinsp,int64_t satoshis,char *paymentscriptstr,char *changeaddr,int64_t txfee,cJSON *addresses,int32_t minconf,uint32_t locktime);
char *bitcoin_blockhashstr(char *coinstr,char *serverport,char *userpass,int32_t height);
bits256 basilisk_blockhash(struct iguana_info *coin,int32_t height);
extern int32_t HDRnet,netBLOCKS;

10
iguana/iguana_blocks.c

@ -494,15 +494,7 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl
//char str[65]; printf("extend? %s.h%d: %.15f vs %.15f ht.%d vs %d\n",bits256_str(str,block->RO.hash2),height,block->PoW,coin->blocks.hwmchain.PoW,height,coin->blocks.hwmchain.height);
if ( iguana_blockvalidate(coin,&valid,newblock,0) < 0 || valid == 0 )
return(0);
if ( coin->MAXPEERS == 1 )
{
char *blockhashstr;
if ( (blockhashstr= bitcoin_blockhashstr(coin->symbol,coin->chain->serverport,coin->chain->userpass,height)) != 0 )
{
block->RO.hash2 = bits256_conv(blockhashstr);
free(blockhashstr);
}
}
block->RO.hash2 = *hash2p = basilisk_blockhash(coin,height);
block->height = height;
block->valid = 1;
if ( block->PoW >= hwmchain->PoW )

3
iguana/iguana_bundles.c

@ -898,7 +898,8 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp,int
datasize = numhashes = numsaved = numrecv = numcached = minrequests = 0;
for (bundlei=0; bundlei<bp->n; bundlei++)
{
if ( bits256_nonz(bp->hashes[bundlei]) > 0 )
bp->hashes[bundlei] = basilisk_blockhash(coin,bp->bundleheight + bundlei);
if ( bits256_nonz(bp->hashes[bundlei]) != 0 )
{
numhashes++;
if ( bp->speculativecache[bundlei] != 0 )

Loading…
Cancel
Save