Browse Source

recv tweaks

notary
dPoW2
jl777 8 years ago
parent
commit
e175982c18
  1. 2
      .gitignore
  2. 2
      iguana/coins/genbtcd
  3. 157
      iguana/confs/BTCD_peers.txt
  4. 1
      iguana/genbtcloop
  5. 1
      iguana/genbtcloop8
  6. 5
      iguana/iguana777.c
  7. 17
      iguana/iguana_blocks.c
  8. 15
      iguana/iguana_bundles.c
  9. 13
      iguana/iguana_init.c
  10. 2
      iguana/iguana_payments.c
  11. 20
      iguana/iguana_peers.c
  12. 2
      iguana/iguana_recv.c
  13. 4
      iguana/iguana_tx.c
  14. 42
      iguana/iguana_unspents.c
  15. 5
      iguana/main.c
  16. 1
      iguana/tests/rawtx5
  17. 8
      includes/iguana_defines.h
  18. 10
      includes/iguana_structs.h

2
.gitignore

@ -33,3 +33,5 @@ agents/*
iguana/confs/BTC_hdrs.txt
.DS_Store

2
iguana/coins/genbtcd

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":11,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"minconfirms\":5}"
curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":11,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":256,\"endpend\":256,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"minconfirms\":5}"

157
iguana/confs/BTCD_peers.txt

@ -7,84 +7,79 @@
89.248.160.243
89.248.160.244
89.248.160.245
85.25.217.233
65.15.37.140
62.75.145.171
176.9.13.13
88.198.15.19
51.255.38.28
121.108.241.247
82.229.201.131
162.13.4.69
78.226.160.96
115.28.42.60
178.62.185.131
167.114.249.196
81.181.155.53
76.169.236.235
67.165.77.192
75.130.163.51
72.55.148.203
96.127.136.18
88.198.53.194
63.247.147.166
88.206.186.58
217.8.62.188
46.231.137.186
217.215.190.134
2.86.63.69
59.147.43.232
104.42.224.48
24.168.17.50
173.65.129.85
84.119.62.223
59.147.43.232
2.239.61.146
176.28.45.179
73.211.90.130
185.48.78.78
77.21.104.176
46.253.169.134
163.172.156.107
74.120.222.234
192.99.233.217
162.255.117.105
188.166.91.37
149.56.122.72
71.1.13.122
88.113.76.138
81.205.30.207
203.189.127.54
68.190.213.46
98.202.147.55
89.212.19.49
162.210.92.46
115.70.19.28
68.43.220.127
79.227.171.148
68.46.103.181
98.207.117.83
79.200.255.204
82.8.59.60
71.241.204.215
108.247.198.39
156.57.141.221
92.26.168.113
71.53.157.49
68.45.147.145
79.54.185.53
110.202.11.148
91.82.171.9
74.14.104.167
95.116.195.148
90.113.82.59
98.118.105.12
82.241.71.230
98.161.16.55
89.248.160.237
93.211.231.89
2.26.181.156
89.248.160.244
89.248.160.243
89.248.160.242
89.248.160.241
5.9.102.210
78.47.196.146
85.25.217.233:14631
88.198.53.194:55692
88.206.186.58:37299
162.255.117.105:63084
115.28.42.60:60878
82.176.15.155:35026
88.198.15.19:48150
176.9.13.13:14631
217.8.62.188:52714
162.13.4.69:55410
211.58.177.43:35581
63.247.147.166:50266
24.168.17.50:50793
46.231.137.186:56963
178.62.185.131:35572
62.75.145.171:14631
89.212.19.49:48018
192.99.233.217:42232
68.190.213.46:14631
162.210.92.46:14631
98.118.105.12:60805
75.130.163.51:56719
51.255.38.28:14631
88.110.117.18:52158
24.101.114.249:55457
99.44.222.86:62377
108.61.166.209:58365
98.208.113.72:62065
72.133.226.130:14631
5.189.144.97:58243
14.203.46.202:57987
98.202.147.55:60460
24.45.172.109:14631
89.114.38.65:52768
68.59.64.126:50633
68.43.220.127:4303
81.205.30.207:63077
113.87.28.142:62764
73.211.90.130:41271
110.174.129.213:49252
68.45.147.145:57803
95.232.175.161:62633
73.229.133.160:38440
124.191.14.253:54342
167.114.249.196:52705
92.24.168.248:52892
93.158.216.201:14631
158.69.27.82:46643
104.204.109.11:63390
68.157.88.187:56711
71.53.152.87:5234
82.229.201.131:63466
59.147.42.146:57461
81.0.91.211:53187
82.241.71.230:51945
108.247.198.39:64094
77.22.227.8:65093
122.166.169.11:49325
173.76.182.122:14631
173.24.82.253:14631
100.13.54.119:14631
2.26.181.208:14631
94.242.213.3:14631
87.149.45.42:36077
98.207.117.83:50955
71.1.8.48:14631
71.1.8.48:50439
101.166.241.31:14631
178.143.154.142:27497
103.255.7.59:58660
156.57.132.119:62428
60.225.171.82:36834
46.223.149.120:43358
37.157.215.75:4162

1
iguana/genbtcloop

@ -2,5 +2,6 @@ while true
do
../agents/iguana coins/genbtc.json
sleep 3
rm -rf tmp
done

1
iguana/genbtcloop8

@ -2,5 +2,6 @@ while true
do
../agents/iguana coins/genbtc8.json
sleep 3
rm -rf tmp
done

5
iguana/iguana777.c

@ -538,6 +538,8 @@ int32_t iguana_utxogen(struct supernet_info *myinfo,struct iguana_info *coin,int
printf("%s helperid.%d waiting for spendvectorsaved.%u v.%d u.%d b.%d vs max.%d\n",coin->symbol,helperid,coin->spendvectorsaved,iguana_validated(coin),iguana_utxofinished(coin),iguana_balancefinished(coin),max);
sleep(2*IGUANA_NUMHELPERS+3);
}*/
if ( convertflag == 0 )
{
if ( helperid < incr )
{
for (hdrsi=helperid; hdrsi<max; hdrsi+=incr)
@ -548,6 +550,7 @@ int32_t iguana_utxogen(struct supernet_info *myinfo,struct iguana_info *coin,int
//printf("helperid.%d convertfinished.%d vs max %d bundlescount.%d\n",helperid,n,max,coin->bundlescount);
sleep(IGUANA_NUMHELPERS+3);
}
}
if ( helperid == 0 )
{
printf("%s start iguana_update_balances\n",coin->symbol);
@ -691,7 +694,7 @@ void iguana_helper(void *arg)
if ( coin->firstRTheight == 0 )
{
if ( coin->spendvectorsaved == 1 )
iguana_utxogen(myinfo,coin,helperid,0);
iguana_utxogen(myinfo,coin,helperid,1);
else if ( coin->spendvectorsaved > 1 && (coin->spendvalidated & (1 << helperid)) == 0 )
{
//printf("%s spendvectorsaved.%u helperid.%d validate\n",coin->symbol,coin->spendvectorsaved,helperid);

17
iguana/iguana_blocks.c

@ -654,9 +654,10 @@ struct iguana_block *_iguana_chainlink(struct supernet_info *myinfo,struct iguan
}
struct iguana_bundle *bp; int32_t hdrsi;
bundlei = (block->height % coin->chain->bundlesize);
hdrsi = (block->height / coin->chain->bundlesize);
if ( bundlei == 0 )
{
if ( (hdrsi= block->height/coin->chain->bundlesize) < coin->bundlescount )
if ( hdrsi < coin->bundlescount )
{
if ( (bp= coin->bundles[hdrsi]) != 0 && bits256_cmp(block->RO.hash2,bp->hashes[0]) != 0 )
{
@ -673,7 +674,7 @@ struct iguana_block *_iguana_chainlink(struct supernet_info *myinfo,struct iguan
}
else
{
if ( (bp= coin->bundles[block->height / coin->chain->bundlesize]) != 0 )
if ( (bp= coin->bundles[hdrsi]) != 0 )
{
if ( memcmp(bp->hashes[bundlei].bytes,block->RO.hash2.bytes,sizeof(bits256)) != 0 || block != bp->blocks[bundlei] )
{
@ -698,6 +699,12 @@ struct iguana_block *_iguana_chainlink(struct supernet_info *myinfo,struct iguan
iguana_blockunmark(coin,block,bp,bundlei,0);
iguana_bundlehash2add(coin,0,bp,bundlei,block->RO.hash2);
}
else
{
bp->blocks[bundlei] = block;
bp->hashes[bundlei] = block->RO.hash2;
iguana_bundlehash2add(coin,0,bp,bundlei,block->RO.hash2);
}
if ( coin->started != 0 && bundlei == coin->minconfirms && (block->height > coin->longestchain-coin->chain->bundlesize*2 || ((block->height / coin->chain->bundlesize) % 100) == 9) )
{
//printf("savehdrs.[%d] ht.%d\n",bp->hdrsi,block->height);
@ -715,7 +722,13 @@ struct iguana_block *_iguana_chainlink(struct supernet_info *myinfo,struct iguan
process_iguanablock(block->serdata,CHAINPARMS);
}*/
iguana_blockzcopy(coin->chain->zcash,(void *)&coin->blocks.hwmchain,block);
if ( coin->RTheight > 0 )
iguana_RTnewblock(myinfo,coin,block);
block->hdrsi = hdrsi;
block->bundlei = bundlei;
bp = coin->bundles[hdrsi];
if ( bp->blocks[bundlei] != block || bits256_cmp(bp->hashes[bundlei],block->RO.hash2) != 0 )
printf("new hwm [%d:%d] mismatched bundle block\n",hdrsi,bundlei);
return(block);
}
}

15
iguana/iguana_bundles.c

@ -1409,21 +1409,6 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch
}
}
}
//printf("lastbp.[%d]\n",lastpending!=0?lastpending->hdrsi:-1);
/*if ( m > 0 )
{
revsortds(sortbuf,m,sizeof(*sortbuf)*2);
for (i=0; i<m; i++)
{
if ( (bp= coin->bundles[(int32_t)sortbuf[i*2 + 1]]) != 0 )
{
bp->rank = i + 1;
if ( coin->peers.numranked > 0 && i < coin->peers.numranked && (addr= coin->peers.ranked[i]) != 0 )
addr->bp = bp;
}
}
}
free(sortbuf);*/
coin->numremain = n;
coin->blocksrecv = numrecv;
uint64_t tmp; int32_t diff,p = 0; struct tai difft,t = tai_now();

13
iguana/iguana_init.c

@ -255,7 +255,7 @@ int32_t iguana_bundleinitmap(struct supernet_info *myinfo,struct iguana_info *co
void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int32_t iter,FILE *fp)
{
int32_t j,k,m,c,flag,bundlei,lastheight,height = -1; char checkstr[1024],line[1024];
int32_t j,k,m,c,flag,bundlei,lastheight,missing=0,height = -1; char checkstr[1024],line[1024];
struct iguana_peer *addr; struct iguana_bundle *bp; bits256 allhash,hash2,hash1,zero,lastbundle;
if ( coin->FULLNODE == 0 && coin->VALIDATENODE == 0 && iter > 0 )
return;
@ -302,7 +302,7 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3
//printf("parse line.(%s) maxpeers.%d\n",line,coin->MAXPEERS);
if ( iter == 0 )
{
if ( (m < 8 || (rand() % 2) == 0) && (m < 32 || m < coin->MAXPEERS/2) )//&& m < 77.7 )
if ( m < coin->MAXPEERS/2 )
{
if ( 0 && m == 0 )
{
@ -312,12 +312,16 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3
iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD);
}
#ifndef IGUANA_DISABLEPEERS
//if ( (rand() % 2) == 0 )
{
addr = &coin->peers->active[m++];
iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(line));
//printf("call initpeer.(%s)\n",addr->ipaddr);
iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD);
} //else
#endif
}
iguana_possible_peer(coin,line);
}
else
{
@ -374,6 +378,11 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3
{
if ( iguana_bundleinitmap(myinfo,coin,bp,height,hash2,hash1) == 0 )
lastbundle = hash2, lastheight = height;
else if ( missing++ > coin->MAXBUNDLES && strcmp("BTC",coin->symbol) == 0 )
{
printf("missing.%d\n",missing);
break;
}
}
}
}

2
iguana/iguana_payments.c

@ -381,7 +381,7 @@ char *iguana_calcrawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJS
free(unspents);
return(0);
}
printf("avail %.8f satoshis %.8f, txfee %.8f burnamount %.8f\n",dstr(avail),dstr(satoshis),dstr(txfee),dstr(burnamount));
printf("avail %.8f satoshis %.8f, txfee %.8f burnamount %.8f vin0.scriptlen %d\n",dstr(avail),dstr(satoshis),dstr(txfee),dstr(burnamount),unspents[0].spendlen);
if ( txobj != 0 && avail >= satoshis+txfee )
{
if ( (vins= iguana_RTinputsjson(myinfo,coin,&total,satoshis + txfee,unspents,num)) != 0 )

20
iguana/iguana_peers.c

@ -392,6 +392,9 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port)
timeout.tv_sec = 0;
timeout.tv_usec = 30000;
setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout));
timeout.tv_sec = 0;
timeout.tv_usec = 10000;
setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout));
}
opt = 0;
getsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,&slen);
@ -499,14 +502,19 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s
if ( (numsent= (int32_t)send(usock,serialized,remains,MSG_NOSIGNAL)) < 0 )
#endif
{
printf("send errno.%d %s\n",errno,strerror(errno));
if ( errno != EAGAIN && errno != EWOULDBLOCK )
if ( errno == EAGAIN )
{
addr->persistent_peer = 1;
//sleep(1);
//continue;
}
//if ( errno != EAGAIN && errno != EWOULDBLOCK )
{
printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",serialized+4,addr->ipaddr,numsent,remains,len,errno,strerror(errno),addr->usock);
printf("bad errno.%d %s zombify.%p\n",errno,strerror(errno),&addr->dead);
addr->dead = (uint32_t)time(NULL);
return(-errno);
} //else usleep(*sleeptimep), *sleeptimep *= 1.1;
}
}
else if ( remains > 0 )
{
@ -1188,7 +1196,7 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin,
ipbits = (uint32_t)addr->ipbits;
vcalc_sha256(0,addr->iphash.bytes,(uint8_t *)&ipbits,sizeof(ipbits));
//char str[65]; printf("start dedicatedloop.%s addrind.%d %s\n",addr->ipaddr,addr->addrind,bits256_str(str,addr->iphash));
addr->maxfilehash2 = IGUANA_MAXFILEITEMS;
//addr->maxfilehash2 = IGUANA_MAXFILEITEMS;
bufsize = IGUANA_MAXPACKETSIZE;
if ( addr->blockspace == 0 )
addr->blockspace = mycalloc('r',1,bufsize + 8192);
@ -1311,8 +1319,8 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin,
}
iguana_iAkill(coin,addr,addr->dead != 0);
myfree(buf,bufsize);
if ( addr->filehash2 != 0 )
myfree(addr->filehash2,addr->maxfilehash2*sizeof(*addr->filehash2)), addr->filehash2 = 0;
//if ( addr->filehash2 != 0 )
// myfree(addr->filehash2,addr->maxfilehash2*sizeof(*addr->filehash2)), addr->filehash2 = 0;
if ( 0 )
{
iguana_mempurge(&addr->RAWMEM);

2
iguana/iguana_recv.c

@ -769,7 +769,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
origtxdata->zblock.RO.recvlen = 0;
printf("gotblockM2: error finding block %s\n",bits256_str(str,origtxdata->zblock.RO.hash2));
return;
} else printf("getblockM autoextended.[%d]\n",bp->hdrsi);
} //else printf("getblockM autoextended.[%d]\n",bp->hdrsi);
}
}
if ( bp == 0 )

4
iguana/iguana_tx.c

@ -237,8 +237,8 @@ int32_t iguana_ramtxbytes(struct iguana_info *coin,uint8_t *serialized,int32_t m
*txidp = bits256_doublesha256(txidstr,serialized,len);
if ( memcmp(txidp,tx->txid.bytes,sizeof(*txidp)) != 0 )
{
//for (i=0; i<len; i++)
// printf("%02x",serialized[i]);
for (i=0; i<len; i++)
printf("%02x",serialized[i]);
char str[65],str2[65]; printf("\nrw.%d numvins.%d numvouts.%d error generating txbytes txid %s vs %s\n",rwflag,numvins,numvouts,bits256_str(str,*txidp),bits256_str(str2,tx->txid));
return(-1);
}

42
iguana/iguana_unspents.c

@ -380,6 +380,33 @@ int32_t iguana_uheight(struct iguana_info *coin,int32_t bundleheight,struct igua
else return(bundleheight);
}
int32_t iguana_outpt_set(struct iguana_info *coin,struct iguana_outpoint *outpt,struct iguana_unspent *u,uint32_t unspentind,int16_t hdrsi,bits256 txid,int32_t vout)
{
char scriptstr[IGUANA_MAXSCRIPTSIZE*2+1]; uint8_t rmd160[20],pubkey33[33];
memset(outpt,0,sizeof(*outpt));
outpt->txid = txid;
outpt->vout = vout;
outpt->hdrsi = hdrsi;
outpt->isptr = 0;
outpt->unspentind = unspentind;
outpt->value = u->value;
memset(rmd160,0,sizeof(rmd160));
memset(pubkey33,0,sizeof(pubkey33));
if ( iguana_scriptget(coin,scriptstr,0,sizeof(scriptstr),outpt->hdrsi,outpt->unspentind,outpt->txid,outpt->vout,rmd160,u->type,pubkey33) != 0 )
{
outpt->spendlen = (int32_t)strlen(scriptstr) >> 1;
if ( outpt->spendlen < sizeof(outpt->spendscript) )
decode_hex(outpt->spendscript,outpt->spendlen,scriptstr);
else
{
outpt->spendlen = 0;
printf("error scriptstr.(%s) is too big for %d\n",scriptstr,(int32_t)sizeof(outpt->spendscript));
return(-1);
}
}
return(0);
}
int32_t iguana_datachain_scan(struct supernet_info *myinfo,struct iguana_info *coin,uint8_t rmd160[20])
{
int64_t deposits,crypto777_payment; struct iguana_outpoint lastpt; uint32_t unspentind; int32_t i,j,num,uheight; struct iguana_bundle *bp; struct iguana_ramchain *ramchain; struct iguana_ramchaindata *rdata; struct iguana_pkhash *P,p; struct iguana_unspent *U,*u; struct iguana_txid *T,*tx;
@ -438,6 +465,13 @@ int32_t iguana_RTscanunspents(struct supernet_info *myinfo,struct iguana_info *c
outpt.vout = unspent->vout;
outpt.value = unspent->value;
outpt.hdrsi = unspent->height / coin->chain->bundlesize;
if ( (outpt.spendlen= unspent->scriptlen) > 0 && outpt.spendlen < sizeof(outpt.spendscript) )
memcpy(outpt.spendscript,unspent->script,outpt.spendlen);
else
{
printf("spendscript.%d doesnt fit into %d\n",outpt.spendlen,(int32_t)sizeof(outpt.spendscript));
outpt.spendlen = 0;
}
if ( array != 0 )
jaddi(array,iguana_RTunspentjson(myinfo,coin,outpt,txid,unspent->vout,unspent->value,0,rmd160,coinaddr,pubkey33,spentheight,remoteaddr));
*depositsp += unspent->value;
@ -495,13 +529,7 @@ int64_t iguana_RTpkhashbalance(struct supernet_info *myinfo,struct iguana_info *
{
//printf("u%u ",unspentind);
deposits += U[unspentind].value;
memset(&outpt,0,sizeof(outpt));
outpt.txid = T[U[unspentind].txidind].txid;
outpt.vout = unspentind - T[U[unspentind].txidind].firstvout;
outpt.hdrsi = lastpt.hdrsi;
outpt.isptr = 0;
outpt.unspentind = unspentind;
outpt.value = U[unspentind].value;
iguana_outpt_set(coin,&outpt,&U[unspentind],unspentind,lastpt.hdrsi,T[U[unspentind].txidind].txid,unspentind - T[U[unspentind].txidind].firstvout);
RTspend = 0;
if ( iguana_RTspentflag(myinfo,coin,&RTspend,&spentheight,ramchain,outpt,lastheight,minconf,maxconf,U[unspentind].value) == 0 )
{

5
iguana/main.c

@ -339,7 +339,12 @@ char *SuperNET_JSON(struct supernet_info *myinfo,struct iguana_info *coin,cJSON
void iguana_exit(struct supernet_info *myinfo,struct iguana_bundle *bp)
{
static int exiting;
int32_t i,j,iter; struct iguana_info *coin,*tmp;
if ( exiting != 0 )
while ( 1 )
sleep(1);
exiting = 1;
if ( myinfo == 0 )
myinfo = SuperNET_MYINFO(0);
printf("start EXIT\n");

1
iguana/tests/rawtx5

@ -0,0 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"RD1rFucYCMhCGeEqdztivP3DFdJwVAzXn7\",\"addresses\":[\"RD1rFucYCMhCGeEqdztivP3DFdJwVAzXn7\"],\"timeout\":15000,\"satoshis\":\"130000\",\"spendscript\":\"76a9145da2ae69885741a6946e01ad8aa8b5312eed856088ac\"}}"

8
includes/iguana_defines.h

@ -58,16 +58,12 @@
#define IGUANA_MAXBUNDLES (50000000 / 500)
#define IGUANA_MINPEERS 64
#define IGUANA_LOG2MAXPEERS 11
#define IGUANA_LOG2PEERFILESIZE 23
#define IGUANA_LOG2MAXPEERS 11 // cant exceed 13 bits as ramchain unspents has bitfield
#define IGUANA_MAXPEERS (1 << IGUANA_LOG2MAXPEERS)
#define IGUANA_LOG2PACKETSIZE 21
#define IGUANA_MAXPACKETSIZE (1 << IGUANA_LOG2PACKETSIZE)
#define IGUANA_PEERFILESIZE (1 << IGUANA_LOG2PEERFILESIZE)
struct iguana_txdatabits { uint64_t addrind:IGUANA_LOG2MAXPEERS,filecount:10,fpos:IGUANA_LOG2PEERFILESIZE,datalen:IGUANA_LOG2PACKETSIZE,isdir:1; };
#define IGUANA_MAXFILEITEMS 8192
//#define IGUANA_MAXFILEITEMS 8192
#define IGUANA_RECENTPEER (3600 * 24 * 7)
#define IGUANA_PERMTHREAD 0

10
includes/iguana_structs.h

@ -183,7 +183,7 @@ struct iguana_packet { struct queueitem DL; struct iguana_peer *addr; struct tai
struct msgcounts { uint32_t version,verack,getaddr,addr,inv,getdata,notfound,getblocks,getheaders,headers,tx,block,mempool,ping,pong,reject,filterload,filteradd,filterclear,merkleblock,alert; };
struct iguana_fileitem { bits256 hash2; struct iguana_txdatabits txdatabits; };
//struct iguana_fileitem { bits256 hash2; struct iguana_txdatabits txdatabits; };
struct iguana_kvitem { UT_hash_handle hh; uint8_t keyvalue[]; }PACKEDSTRUCT;
@ -272,9 +272,9 @@ struct iguana_spend256 { bits256 prevhash2; uint64_t scriptpos:48,vinscriptlen:1
// permanent readonly structs
struct iguana_txid { bits256 txid; uint64_t txidind:29,firstvout:28,firstvin:28,bundlei:11,locktime:32,version:32,timestamp:32,extraoffset:32; uint16_t numvouts,numvins; }PACKEDSTRUCT;
struct iguana_unspent { uint64_t value; uint32_t txidind,pkind,prevunspentind,scriptpos; uint16_t scriptlen,hdrsi; uint16_t fileid:11,type:5; int16_t vout; }PACKEDSTRUCT;
struct iguana_unspent { uint64_t value; uint32_t txidind,pkind,prevunspentind,scriptpos,scriptlen:13,fileid:14,type:5; uint16_t hdrsi; int16_t vout; } PACKEDSTRUCT;
struct iguana_spend { uint64_t scriptpos:48,scriptlen:16; uint32_t spendtxidind,sequenceid; int16_t prevout; uint16_t fileid:15,external:1; }PACKEDSTRUCT; // numsigs:4,numpubkeys:4,p2sh:1,sighash:4
struct iguana_spend { uint64_t scriptpos:48,scriptlen:16; uint32_t spendtxidind,sequenceid; int16_t prevout; uint16_t fileid:14,external:1,tbd:1; }PACKEDSTRUCT; // numsigs:4,numpubkeys:4,p2sh:1,sighash:4
struct iguana_pkhash { uint8_t rmd160[20]; uint32_t pkind; }PACKEDSTRUCT; //firstunspentind,pubkeyoffset
@ -349,7 +349,7 @@ struct iguana_peer
struct msgcounts msgcounts;
struct OS_memspace RAWMEM,TXDATA,HASHMEM;
struct iguana_ramchain ramchain;
struct iguana_fileitem *filehash2; int32_t numfilehash2,maxfilehash2;
//struct iguana_fileitem *filehash2; int32_t numfilehash2,maxfilehash2;
FILE *voutsfp,*vinsfp;
uint8_t *blockspace;//[IGUANA_MAXPACKETSIZE + 8192];
#ifdef IGUANA_PEERALLOC
@ -391,7 +391,7 @@ struct iguana_bundlereq
{
struct queueitem DL; struct iguana_info *coin; int32_t type;
struct iguana_peer *addr; struct iguana_zblock *blocks; bits256 *hashes,txid;
struct iguana_txdatabits txdatabits;
//struct iguana_txdatabits txdatabits;
struct iguana_msghdr H;
int32_t allocsize,datalen,n,recvlen,numtx; uint32_t ipbits;
struct iguana_zblock zblock;

Loading…
Cancel
Save