From aaf7cb136e2c2a000de1392cbf4674b122a71cf2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 6 Apr 2016 02:09:14 -0500 Subject: [PATCH] test --- iguana/iguana777.h | 2 +- iguana/iguana_unspents.c | 7 ++++++- iguana/main.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index d5e48a703..bda3060e2 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -387,7 +387,7 @@ struct iguana_ramchain void *fileptr,*sigsfileptr,*Xspendptr,*debitsfileptr,*lastspendsfileptr; char from_ro,from_roX,from_roA,from_roU; struct iguana_account *A,*creditsA; struct iguana_spendvector *Xspendinds; - struct iguana_utxo *Uextras; + struct iguana_utxo *Uextras; uint8_t *txbits; int16_t permutation[IGUANA_MAXBUNDLES]; //struct iguana_Uextra *U2,*roU2; struct iguana_pkextra *P2,*roP2; }; diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index fe85bb9cf..a4affff23 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -398,7 +398,8 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st ramchain = (bp->isRT != 0) ? &coin->RTramchain : &bp->ramchain; if ( ramchain->H.data != 0 ) { - TXbits = (void *)(long)((long)ramchain->H.data + ramchain->H.data->TXoffset); + if ( (TXbits= ramchain->txbits) == 0 ) + TXbits = (void *)(long)((long)ramchain->H.data + ramchain->H.data->TXoffset); T = (void *)(long)((long)ramchain->H.data + ramchain->H.data->Toffset); if ( (txidind= iguana_sparseaddtx(TXbits,ramchain->H.data->txsparsebits,ramchain->H.data->numtxsparse,txid,T,0,ramchain)) > 0 ) { @@ -1211,6 +1212,10 @@ int32_t iguana_mapvolatiles(struct iguana_info *coin,struct iguana_ramchain *ram if ( err == 0 ) { //printf("mapped extra.%s\n",fname); + int32_t tlen; uint8_t *TXbits = (uint8_t *)((long)ramchain->H.data + ramchain->H.data->TXoffset); + tlen = (int32_t)hconv_bitlen(ramchain->H.data->numtxsparse * ramchain->H.data->txsparsebits); + ramchain->txbits = calloc(1,tlen); + memcpy(ramchain->txbits,TXbits,tlen); break; } iguana_purgevolatiles(coin,ramchain); diff --git a/iguana/main.c b/iguana/main.c index 01558409a..22942bd3d 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -1243,7 +1243,7 @@ void iguana_main(void *arg) if ( 1 ) { sleep(1); - if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":512,\"endpend\":512,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) + if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":128,\"endpend\":64,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) { free(str); if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0,myinfo->rpcport)) != 0 )