Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
55666b0342
  1. 1
      iguana/iguana777.h
  2. 2
      iguana/iguana_accept.c
  3. 9
      iguana/iguana_blocks.c
  4. 2
      iguana/iguana_init.c
  5. 2
      iguana/iguana_tx.c

1
iguana/iguana777.h

@ -1014,6 +1014,7 @@ double iguana_txidstatus(struct iguana_info *coin,bits256 txid);
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);
extern int32_t HDRnet,netBLOCKS;

2
iguana/iguana_accept.c

@ -300,7 +300,7 @@ int32_t iguana_peerhdrrequest(struct iguana_info *coin,uint8_t *serialized,int32
iguana_blockunconv(&msgB,block,1);
len += iguana_rwblock(coin->chain->hashalgo,1,&checkhash2,&serialized[sizeof(struct iguana_msghdr) + len],&msgB);
flag++;
if ( bits256_cmp(checkhash2,block->RO.hash2) != 0 )
if ( coin->MAXPEERS == 1 && bits256_cmp(checkhash2,block->RO.hash2) != 0 )
{
char str[65],str2[65];
printf("iguana_peerhdrrequest blockhash.%d error (%s) vs (%s)\n",height+i,bits256_str(str,checkhash2),bits256_str(str2,block->RO.hash2));

9
iguana/iguana_blocks.c

@ -494,6 +494,15 @@ 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->height = height;
block->valid = 1;
if ( block->PoW >= hwmchain->PoW )

2
iguana/iguana_init.c

@ -87,7 +87,7 @@ bits256 iguana_genesis(struct iguana_info *coin,struct iguana_chain *chain)
decode_hex(buf,(int32_t)strlen(chain->genesis_hex)/2,(char *)chain->genesis_hex);
hash2 = iguana_calcblockhash(coin->chain->hashalgo,buf,sizeof(struct iguana_msgblockhdr));
iguana_rwblock(coin->chain->hashalgo,0,&hash2,buf,&msg);
if ( memcmp(hash2.bytes,chain->genesis_hashdata,sizeof(hash2)) != 0 )
if ( coin->MAXPEERS > 1 && memcmp(hash2.bytes,chain->genesis_hashdata,sizeof(hash2)) != 0 )
{
bits256_str(str,hash2);
printf("genesis mismatch? calculated %s vs %s\n",str,bits256_str(str2,*(bits256 *)chain->genesis_hashdata));

2
iguana/iguana_tx.c

@ -231,7 +231,7 @@ int32_t iguana_peerblockrequest(struct iguana_info *coin,uint8_t *blockspace,int
iguana_blockunconv(&msgB,block,0);
msgB.txn_count = block->RO.txn_count;
total = iguana_rwblock(coin->chain->hashalgo,1,&checkhash2,&blockspace[sizeof(struct iguana_msghdr) + 0],&msgB);
if ( bits256_cmp(checkhash2,block->RO.hash2) != 0 )
if ( coin->MAXPEERS > 1 && bits256_cmp(checkhash2,block->RO.hash2) != 0 )
{
static int counter;
if ( counter++ < 100 )

Loading…
Cancel
Save