Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
ea6d0c6d72
  1. 10
      iguana/iguana_unspents.c

10
iguana/iguana_unspents.c

@ -1752,13 +1752,17 @@ int32_t iguana_realtime_update(struct iguana_info *coin)
//starti = coin->RTheight % coin->chain->bundlesize;
if ( (bp= coin->current) != 0 && bp->hdrsi == coin->longestchain/coin->chain->bundlesize && bp->hdrsi == coin->balanceswritten && coin->RTheight >= bp->bundleheight && coin->RTheight < bp->bundleheight+bp->n && ((coin->RTheight <= coin->blocks.hwmchain.height && time(NULL) > bp->lastRT) || time(NULL) > bp->lastRT+10) )
{
if ( (block= bp->blocks[0]) != 0 && block->mainchain == 0 )
if ( (block= bp->blocks[0]) == 0 || block->txvalid == 0 || block->mainchain == 0 )
{
if ( _iguana_chainlink(coin,block) == 0 )
if ( block != 0 )
{
_iguana_chainlink(coin,block);
block->txvalid = 0;
}
{
uint8_t serialized[512]; int32_t len; struct iguana_peer *addr;
hash2 = bp->hashes[0];
char str[65]; printf("RT error [%d:%d] %s %p\n",bp->hdrsi,0,bits256_str(str,hash2),block);
char str[65]; printf("RT[0] [%d:%d] %s %p\n",bp->hdrsi,0,bits256_str(str,hash2),block);
addr = coin->peers.ranked[rand() % 8];
if ( addr != 0 && addr->usock >= 0 && addr->dead == 0 && (len= iguana_getdata(coin,serialized,MSG_BLOCK,&hash2,1)) > 0 )
iguana_send(coin,addr,serialized,len);

Loading…
Cancel
Save