Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
e6384cfec8
  1. 2
      iguana/iguana777.c
  2. 7
      iguana/iguana_recv.c

2
iguana/iguana777.c

@ -426,7 +426,7 @@ void iguana_update_balances(struct iguana_info *coin)
if ( coin->bundles[max-1] != 0 && coin->bundles[max-1]->emitfinish <= 1 && coin->RTheight == 0 ) if ( coin->bundles[max-1] != 0 && coin->bundles[max-1]->emitfinish <= 1 && coin->RTheight == 0 )
max--; max--;
//coin->spendvectorsaved = 0; //coin->spendvectorsaved = 0;
if ( iguana_spendvectorsaves(coin) == 0 ) //iguana_balancefinished(coin) < max && if ( iguana_balancefinished(coin) < max && iguana_spendvectorsaves(coin) == 0 ) //
{ {
if ( coin->origbalanceswritten <= 1 ) if ( coin->origbalanceswritten <= 1 )
hdrsi = 0; hdrsi = 0;

7
iguana/iguana_recv.c

@ -806,14 +806,15 @@ int32_t iguana_height_estimate(struct iguana_info *coin,struct iguana_block **ma
{ {
int32_t i,n; struct iguana_block *tmp = block; int32_t i,n; struct iguana_block *tmp = block;
*mainchainp = 0; *mainchainp = 0;
for (i=n=0; i<coin->chain->bundlesize*10; i++) for (i=n=0; i<coin->chain->bundlesize; i++)
{ {
if ( tmp != 0 && (tmp= iguana_blockfind("estimate",coin,tmp->RO.hash2)) != 0 ) if ( tmp != 0 && (tmp= iguana_blockfind("estimate",coin,tmp->RO.hash2)) != 0 )
{ {
if ( tmp->mainchain != 0 ) if ( tmp->mainchain != 0 )
{ {
char str[65]; char str[65];
printf("%s M.%d dist.%d -> %d\n",bits256_str(str,block->RO.hash2),tmp->height,n,tmp->height+n); if ( n > 0 )
printf("%s M.%d dist.%d -> %d\n",bits256_str(str,block->RO.hash2),tmp->height,n,tmp->height+n);
*mainchainp = tmp; *mainchainp = tmp;
return(tmp->height + n); return(tmp->height + n);
} }
@ -1221,7 +1222,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_bundlereq *req,struct iguana_zblock *origblock,int32_t numtx,int32_t datalen,int32_t recvlen,int32_t *newhwmp) struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_bundlereq *req,struct iguana_zblock *origblock,int32_t numtx,int32_t datalen,int32_t recvlen,int32_t *newhwmp)
{ {
struct iguana_bundle *bp=0,*prev; int32_t n,bundlei = -2; struct iguana_block *block,*next,*prevblock; char str[65]; bits256 hash2; struct iguana_bundle *bp=0,*prev; int32_t n,bundlei = -2; struct iguana_block *block,*next,*prevblock; char str[65]; bits256 hash2;
printf("%s received.(%s) %s\n",coin->symbol,bits256_str(str,origblock->RO.hash2),addr->ipaddr); //printf("%s received.(%s) %s\n",coin->symbol,bits256_str(str,origblock->RO.hash2),addr->ipaddr);
if ( (block= iguana_blockfind("recv",coin,origblock->RO.hash2)) != 0 ) if ( (block= iguana_blockfind("recv",coin,origblock->RO.hash2)) != 0 )
iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock); iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock);
else if ( (block= iguana_blockhashset("recvblock",coin,-1,origblock->RO.hash2,1)) == 0 ) else if ( (block= iguana_blockhashset("recvblock",coin,-1,origblock->RO.hash2,1)) == 0 )

Loading…
Cancel
Save