Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
bd36bc576b
  1. 2
      basilisk/basilisk_bitcoin.c
  2. 4
      gecko/gecko.c
  3. 2
      gecko/gecko_blocks.c
  4. 2
      iguana/coins/gendgb
  5. 2
      iguana/coins/geneac
  6. 4
      iguana/iguana_msg.c
  7. 3
      iguana/iguana_realtime.c
  8. 2
      iguana/iguana_tx.c
  9. 2
      iguana/iguana_unspents.c
  10. 4
      includes/iguana_defines.h

2
basilisk/basilisk_bitcoin.c

@ -263,7 +263,7 @@ int32_t basilisk_bitcoinscan(struct iguana_info *coin,uint8_t origblockspace[IGU
else iguana_memreset(rawmem); else iguana_memreset(rawmem);
memset(&txdata,0,sizeof(txdata)); memset(&txdata,0,sizeof(txdata));
memset(&H,0,sizeof(H)); memset(&H,0,sizeof(H));
if ( (n= iguana_gentxarray(coin,rawmem,&txdata,&len,blockspace,datalen)) == datalen ) if ( (n= iguana_gentxarray(coin,rawmem,&txdata,&len,blockspace,datalen)) == datalen || n == datalen-1 )
{ {
len = n; len = n;
iguana_gotblockM(coin,0,&txdata,rawmem->ptr,&H,blockspace,datalen,0); iguana_gotblockM(coin,0,&txdata,rawmem->ptr,&H,blockspace,datalen,0);

4
gecko/gecko.c

@ -170,7 +170,7 @@ struct gecko_chain *gecko_chain(struct supernet_info *myinfo,char chainname[GECK
struct iguana_info *basilisk_geckochain(struct supernet_info *myinfo,char *symbol,char *chainname,cJSON *valsobj) struct iguana_info *basilisk_geckochain(struct supernet_info *myinfo,char *symbol,char *chainname,cJSON *valsobj)
{ {
int32_t datalen,hdrsize,len=0; struct iguana_info *virt=0; char *hexstr; uint8_t hexbuf[8192],*ptr,*serialized; struct iguana_peer *addr; struct iguana_txblock txdata; int32_t n,datalen,hdrsize,len=0; struct iguana_info *virt=0; char *hexstr; uint8_t hexbuf[8192],*ptr,*serialized; struct iguana_peer *addr; struct iguana_txblock txdata;
portable_mutex_lock(&myinfo->gecko_mutex); portable_mutex_lock(&myinfo->gecko_mutex);
printf("basilisk_geckochain symbol.%s chain.%s (%s)\n",symbol,chainname,jprint(valsobj,0)); printf("basilisk_geckochain symbol.%s chain.%s (%s)\n",symbol,chainname,jprint(valsobj,0));
if ( iguana_coinfind(symbol) == 0 && (hexstr= jstr(valsobj,"genesisblock")) != 0 && (virt= iguana_coinadd(symbol,chainname,valsobj,1)) != 0 ) if ( iguana_coinfind(symbol) == 0 && (hexstr= jstr(valsobj,"genesisblock")) != 0 && (virt= iguana_coinadd(symbol,chainname,valsobj,1)) != 0 )
@ -212,7 +212,7 @@ struct iguana_info *basilisk_geckochain(struct supernet_info *myinfo,char *symbo
if ( virt->blocks.hwmchain.height == 0 ) if ( virt->blocks.hwmchain.height == 0 )
{ {
memset(&txdata,0,sizeof(txdata)); memset(&txdata,0,sizeof(txdata));
if ( iguana_gentxarray(virt,&virt->TXMEM,&txdata,&len,serialized,datalen) == datalen ) if ( (n= iguana_gentxarray(virt,&virt->TXMEM,&txdata,&len,serialized,datalen) == datalen) || n == datalen-1 )
{ {
txdata.zblock.height = 0; txdata.zblock.height = 0;
txdata.zblock.RO.allocsize = iguana_ROallocsize(virt); txdata.zblock.RO.allocsize = iguana_ROallocsize(virt);

2
gecko/gecko_blocks.c

@ -186,7 +186,7 @@ char *gecko_blockarrived(struct supernet_info *myinfo,struct iguana_info *virt,c
struct iguana_txblock txdata; int32_t height,valid,adjacent,gap,n,i,j,len = -1; struct iguana_block *block,*prev; struct iguana_txid tx; char str[65],str2[65]; bits256 txid,threshold; struct iguana_msgtx *txs; struct iguana_txblock txdata; int32_t height,valid,adjacent,gap,n,i,j,len = -1; struct iguana_block *block,*prev; struct iguana_txid tx; char str[65],str2[65]; bits256 txid,threshold; struct iguana_msgtx *txs;
memset(&txdata,0,sizeof(txdata)); memset(&txdata,0,sizeof(txdata));
iguana_memreset(&virt->TXMEM); iguana_memreset(&virt->TXMEM);
if ( (n= iguana_gentxarray(virt,&virt->TXMEM,&txdata,&len,data,datalen)) == datalen ) if ( (n= iguana_gentxarray(virt,&virt->TXMEM,&txdata,&len,data,datalen)) == datalen || n == datalen-1 )
{ {
if ( bits256_cmp(hash2,txdata.zblock.RO.hash2) != 0 ) if ( bits256_cmp(hash2,txdata.zblock.RO.hash2) != 0 )
{ {

2
iguana/coins/gendgb

@ -1,3 +1,3 @@
curl --url "http://127.0.0.1:7778" --data "{\"startpend\":512,\"endpend\":64,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"DGB\",\"name\":\"Digibyte\",\"netmagic\":\"FAC3B6DA\",\"p2p\":12024,\"rpc\":14022,\"pubval\":0,\"p2shval\":5,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"minconfirms\":2,\"genesishash\":\"7497ea1b465eb39f1c8f507bc877078fe016d6fcb6dfad3a64c98dcc6e1e8496\",\"genesis\":{\"version\":1,\"timestamp\":1389388394,\"nBits\":\"1e0ffff0\",\"nonce\":2447652,\"merkle_root\":\"72ddd9496b004221ed0557358846d9248ecd4c440ebd28ed901efc18757d0fad\"},\"alertpubkey\":\"04F04441C4757F356290A37C313C3772C5BC5003E898EB2E0CF365795543A7BF690C8BBBFA32EE3A3325477CE2000B7D0453EFBB203329D0F9DF34D5927D022BC9\"}" curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"DGB\",\"name\":\"Digibyte\",\"netmagic\":\"FAC3B6DA\",\"p2p\":12024,\"rpc\":14022,\"pubval\":0,\"p2shval\":5,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"minconfirms\":2,\"genesishash\":\"7497ea1b465eb39f1c8f507bc877078fe016d6fcb6dfad3a64c98dcc6e1e8496\",\"genesis\":{\"version\":1,\"timestamp\":1389388394,\"nBits\":\"1e0ffff0\",\"nonce\":2447652,\"merkle_root\":\"72ddd9496b004221ed0557358846d9248ecd4c440ebd28ed901efc18757d0fad\"},\"alertpubkey\":\"04F04441C4757F356290A37C313C3772C5BC5003E898EB2E0CF365795543A7BF690C8BBBFA32EE3A3325477CE2000B7D0453EFBB203329D0F9DF34D5927D022BC9\"}"

2
iguana/coins/geneac

@ -1,2 +1,2 @@
curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"EAC\",\"name\":\"EarthCoin\",\"netmagic\":\"C0DBF1FD\",\"p2p\":15677,\"rpc\":15678,\"pubval\":30,\"p2shval\":5,\"wifval\":221,\"txfee_satoshis\":\"1000000\",\"minconfirms\":2,\"genesishash\":\"21717d4df403301c0538f1cb9af718e483ad06728bbcd8cc6c9511e2f9146ced\",\"genesis\":{\"version\":1,\"timestamp\":1386746168,\"nBits\":\"1e0ffff0\",\"nonce\":12468024,\"merkle_root\":\"13757c3610411891452ac1f04d7f81946339b0e5b5aba216e6646e81805c4bb1\"},\"alertpubkey\":\"04dcba12349012341234900abcd12223abcd455abcd77788abcd000000aaaaabbbbbcccccdddddeeeeeff00ff00ff00ff001234567890abcdef0022446688abc11\"}" curl --url "http://127.0.0.1:7778" --data "{\"auxpow\":0,\"txhastimestamp\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"EAC\",\"name\":\"EarthCoin\",\"netmagic\":\"C0DBF1FD\",\"p2p\":15677,\"rpc\":15678,\"pubval\":30,\"p2shval\":5,\"wifval\":221,\"txfee_satoshis\":\"1000000\",\"minconfirms\":2,\"genesishash\":\"21717d4df403301c0538f1cb9af718e483ad06728bbcd8cc6c9511e2f9146ced\",\"genesis\":{\"version\":1,\"timestamp\":1386746168,\"nBits\":\"1e0ffff0\",\"nonce\":12468024,\"merkle_root\":\"13757c3610411891452ac1f04d7f81946339b0e5b5aba216e6646e81805c4bb1\"},\"alertpubkey\":\"04dcba12349012341234900abcd12223abcd455abcd77788abcd000000aaaaabbbbbcccccdddddeeeeeff00ff00ff00ff001234567890abcdef0022446688abc11\"}"

4
iguana/iguana_msg.c

@ -311,7 +311,7 @@ int32_t iguana_rwmsgalert(struct iguana_info *coin,int32_t rwflag,uint8_t *seria
void iguana_gotversion(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_msgversion *vers) void iguana_gotversion(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_msgversion *vers)
{ {
uint8_t serialized[sizeof(struct iguana_msghdr)]; char *retstr; uint8_t serialized[sizeof(struct iguana_msghdr)]; char *retstr;
//printf("gotversion from %s: starting height.%d services.%llx proto.%d (%s)\n",addr->ipaddr,vers->nStartingHeight,(long long)vers->nServices,vers->nVersion,vers->strSubVer); printf("gotversion from %s: starting height.%d services.%llx proto.%d (%s)\n",addr->ipaddr,vers->nStartingHeight,(long long)vers->nServices,vers->nVersion,vers->strSubVer);
if ( 0 && strncmp(vers->strSubVer,"/iguana",strlen("/iguana")) == 0 ) if ( 0 && strncmp(vers->strSubVer,"/iguana",strlen("/iguana")) == 0 )
{ {
addr->supernet = 1, addr->basilisk = 0; addr->supernet = 1, addr->basilisk = 0;
@ -877,7 +877,7 @@ int32_t iguana_msgparser(struct iguana_info *coin,struct iguana_peer *addr,struc
printf(" auxblock\n"); printf(" auxblock\n");
} }
addr->msgcounts.block++; addr->msgcounts.block++;
if ( (n= iguana_gentxarray(coin,rawmem,&txdata,&len,data,recvlen)) == recvlen ) if ( (n= iguana_gentxarray(coin,rawmem,&txdata,&len,data,recvlen)) == recvlen || n == recvlen-1 )
{ {
len = n; len = n;
iguana_gotblockM(coin,addr,&txdata,rawmem->ptr,H,data,recvlen,fromcache); iguana_gotblockM(coin,addr,&txdata,rawmem->ptr,H,data,recvlen,fromcache);

3
iguana/iguana_realtime.c

@ -680,7 +680,8 @@ struct iguana_RTtxid *iguana_RTtxid(struct iguana_info *coin,struct iguana_block
RTptr->timestamp = timestamp; RTptr->timestamp = timestamp;
RTptr->unspents = (void *)&RTptr->spends[numvins]; RTptr->unspents = (void *)&RTptr->spends[numvins];
HASH_ADD_KEYPTR(hh,coin->RTdataset,RTptr->txid.bytes,sizeof(RTptr->txid),RTptr); HASH_ADD_KEYPTR(hh,coin->RTdataset,RTptr->txid.bytes,sizeof(RTptr->txid),RTptr);
printf("%s txid.(%s) vouts.%d vins.%d version.%d lock.%u t.%u %lld\n",coin->symbol,bits256_str(str,txid),numvouts,numvins,version,locktime,timestamp,(long long)polarity); if ( strcmp("BTC",coin->symbol) != 0 )
printf("%s txid.(%s) vouts.%d vins.%d version.%d lock.%u t.%u %lld\n",coin->symbol,bits256_str(str,txid),numvouts,numvins,version,locktime,timestamp,(long long)polarity);
} }
else if ( RTptr->txn_count != txn_count || RTptr->numvouts != numvouts || RTptr->numvins != numvins ) else if ( RTptr->txn_count != txn_count || RTptr->numvouts != numvouts || RTptr->numvins != numvins )
{ {

2
iguana/iguana_tx.c

@ -320,7 +320,7 @@ int32_t iguana_peerblockrequest(struct iguana_info *coin,uint8_t *blockspace,int
for (i=0; i<16; i++) for (i=0; i<16; i++)
printf("%02x",blockspace[i + sizeof(struct iguana_msghdr)+81]); printf("%02x",blockspace[i + sizeof(struct iguana_msghdr)+81]);
printf(" txhdr\n"); printf(" txhdr\n");
if ( (checklen= iguana_gentxarray(coin,&RAWMEM,&txdata,&checklen,&blockspace[sizeof(struct iguana_msghdr)],total)) != total ) if ( (checklen= iguana_gentxarray(coin,&RAWMEM,&txdata,&checklen,&blockspace[sizeof(struct iguana_msghdr)],total)) != total && checklen != total-1 )
printf("Error reconstructing txarray checklen.%d total.%d\n",checklen,total); printf("Error reconstructing txarray checklen.%d total.%d\n",checklen,total);
} }
return(iguana_queue_send(addr,0,blockspace,"block",total)); return(iguana_queue_send(addr,0,blockspace,"block",total));

2
iguana/iguana_unspents.c

@ -1253,7 +1253,7 @@ int64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *coi
sprintf(fname2,"%s/%s/utxoaddrs.%d",GLOBAL_DBDIR,coin->symbol,height), OS_portable_path(fname2); sprintf(fname2,"%s/%s/utxoaddrs.%d",GLOBAL_DBDIR,coin->symbol,height), OS_portable_path(fname2);
if ( iguana_utxoaddr_map(coin,fname2) != 0 ) if ( iguana_utxoaddr_map(coin,fname2) != 0 )
{ {
if ( 0 && strcmp("BTC",coin->symbol) != 0 ) if ( strcmp("BTC",coin->symbol) != 0 )
errs = iguana_utxoaddr_validate(myinfo,coin,height); errs = iguana_utxoaddr_validate(myinfo,coin,height);
printf("nogen %s HIST BALANCE %s %.8f errs %d\n",fname2,bits256_str(str,coin->utxoaddrhash),dstr(coin->histbalance),errs); printf("nogen %s HIST BALANCE %s %.8f errs %d\n",fname2,bits256_str(str,coin->utxoaddrhash),dstr(coin->histbalance),errs);
if ( errs == 0 && coin->histbalance > 0 && height > 0 ) if ( errs == 0 && coin->histbalance > 0 && height > 0 )

4
includes/iguana_defines.h

@ -147,8 +147,8 @@ extern int32_t IGUANA_NUMHELPERS;
#define MEMPOOL_GD_VERSION 60002 // "mempool" command, enhanced "getdata" behavior starts with this version #define MEMPOOL_GD_VERSION 60002 // "mempool" command, enhanced "getdata" behavior starts with this version
#define NO_BLOOM_VERSION 70011 // "filter*" disabled without NODE_BLOOM after and including this version #define NO_BLOOM_VERSION 70011 // "filter*" disabled without NODE_BLOOM after and including this version
#define PROTOCOL_HEADERS_VERSION 70012 #define PROTOCOL_HEADERS_VERSION 70012
//#define PROTOCOL_VERSION 70002 #define PROTOCOL_VERSION 70003
#define PROTOCOL_VERSION PROTOCOL_HEADERS_VERSION //#define PROTOCOL_VERSION PROTOCOL_HEADERS_VERSION
#define MSG_TX 1 #define MSG_TX 1
#define MSG_BLOCK 2 #define MSG_BLOCK 2

Loading…
Cancel
Save