From 3aeb4a9edc6e9028b70180e17a7bf8e6206c956a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 21 Aug 2016 23:08:10 -0300 Subject: [PATCH] test --- basilisk/basilisk.c | 4 +++- iguana/iguana_unspents.c | 2 ++ iguana/iguana_wallet.c | 1 + includes/iguana_structs.h | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 08d60d04d..b34df690c 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -816,9 +816,11 @@ void basilisks_loop(void *arg) //for (i=0; irelay_RTheights[i] != 0 ) // break; - if ( (time(NULL) % 10) == 0 ) //i == BASILISK_MAXRELAYS || + if ( time(NULL) > coin->lastunspentsupdate+10 ) //i == BASILISK_MAXRELAYS || { + printf(">>>>>>>>>>>>> update\n"); basilisk_unspents_update(myinfo,coin); + coin->lastunspentsupdate = (uint32_t)time(NULL); } } } diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 15434569d..37aeb392a 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1270,6 +1270,7 @@ int64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *coi iguana_RTnewblock(myinfo,coin,block); portable_mutex_unlock(&coin->RTmutex); } + basilisk_unspents_update(myinfo,coin); return(coin->histbalance); } } @@ -1408,6 +1409,7 @@ continue; iguana_RTnewblock(myinfo,coin,block); portable_mutex_unlock(&coin->RTmutex); } + basilisk_unspents_update(myinfo,coin); return(coin->histbalance); } } diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index 2c2d00399..d14b368e1 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -1156,6 +1156,7 @@ TWOSTRINGS_AND_INT(bitcoinrpc,walletpassphrase,password,permanentfile,timeout) retstr = SuperNET_login(IGUANA_CALLARGS,myinfo->handle,password,permanentfile,0); myinfo->expiration = (uint32_t)time(NULL) + timeout; iguana_walletinitcheck(myinfo,coin); + basilisk_unspents_update(myinfo,coin); return(retstr); } diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index 4f0857a6b..29b87213f 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -470,7 +470,7 @@ struct iguana_info struct iguana_utxoaddr *utxoaddrs,*RTprev; uint32_t utxodatasize,utxoaddrind; int64_t histbalance,RTcredits,RTdebits; void *utxoaddrfileptr; long utxoaddrfilesize; - uint32_t utxoaddrlastcount,*utxoaddroffsets; uint8_t *utxoaddrtable; bits256 utxoaddrhash; + uint32_t utxoaddrlastcount,*utxoaddroffsets,lastunspentsupdate; uint8_t *utxoaddrtable; bits256 utxoaddrhash; struct iguana_block *RTblocks[65536]; uint8_t *RTrawdata[65536]; int32_t RTrecvlens[65536],RTnumtx[65536]; struct iguana_RTtxid *RTdataset; struct iguana_RTaddr *RTaddrs; };