Browse Source

Merge pull request #114 from jl777/dPoW

DPoW
master
jl777 8 years ago
committed by GitHub
parent
commit
4cd1f2ded0
  1. 52
      basilisk/basilisk.c
  2. 4
      basilisk/basilisk_MSG.c
  3. 2
      basilisk/basilisk_ping.c
  4. 10
      crypto777/OS_portable.h
  5. 2
      crypto777/bitcoind_RPC.c
  6. 143
      crypto777/iguana_OS.c
  7. 16
      crypto777/iguana_utils.c
  8. 4
      datachain/datachain.c
  9. 21
      deprecated/obsolete.h
  10. 2
      gecko/gecko_blocks.c
  11. 1
      iguana/coins/allofus
  12. 1
      iguana/coins/basilisk
  13. 4
      iguana/coins/btc
  14. 3
      iguana/coins/btc_7776
  15. 1
      iguana/coins/fastbtcd
  16. 3
      iguana/coins/genNAME
  17. 1
      iguana/coins/genanc
  18. 1
      iguana/coins/genblk
  19. 1
      iguana/coins/genbtc
  20. 1
      iguana/coins/genbtcd
  21. 1
      iguana/coins/genbtcdsigs
  22. 1
      iguana/coins/genbtm
  23. 1
      iguana/coins/gencarb
  24. 1
      iguana/coins/gendgb
  25. 1
      iguana/coins/gendoge
  26. 1
      iguana/coins/geneac
  27. 1
      iguana/coins/genfrk
  28. 1
      iguana/coins/gengmc
  29. 4
      iguana/coins/genkmd
  30. 2
      iguana/coins/genltc
  31. 2
      iguana/coins/genmzc
  32. 2
      iguana/coins/gennmc
  33. 2
      iguana/coins/gennotary
  34. 2
      iguana/coins/gensys
  35. 2
      iguana/coins/gentaz
  36. 2
      iguana/coins/genuno
  37. 2
      iguana/coins/genvia
  38. 2
      iguana/coins/genvpn
  39. 2
      iguana/coins/genvrc
  40. 2
      iguana/coins/genzcash
  41. 4
      iguana/coins/genzec
  42. 2
      iguana/coins/genzet
  43. 4
      iguana/coins/kmd
  44. 4
      iguana/coins/kmd_7776
  45. 2
      iguana/coins/m_extract_genesis
  46. 2
      iguana/coins/notary
  47. 4
      iguana/coins/zec
  48. 22
      iguana/dPoW.h
  49. 157
      iguana/dpow/dpow_fsm.c
  50. 68
      iguana/dpow/dpow_network.c
  51. 18
      iguana/dpow/dpow_prices.c
  52. 479
      iguana/dpow/dpow_rpc.c
  53. 64
      iguana/dpow/dpow_tx.c
  54. 2
      iguana/exchanges/okcoin.c
  55. 70
      iguana/iguana777.c
  56. 1
      iguana/iguana777.h
  57. 10
      iguana/iguana_accept.c
  58. 22
      iguana/iguana_blocks.c
  59. 26
      iguana/iguana_bundles.c
  60. 13
      iguana/iguana_chains.c
  61. 22
      iguana/iguana_exchanges.c
  62. 34
      iguana/iguana_init.c
  63. 6
      iguana/iguana_json.c
  64. 39
      iguana/iguana_msg.c
  65. 78
      iguana/iguana_notary.c
  66. 99
      iguana/iguana_peers.c
  67. 101
      iguana/iguana_ramchain.c
  68. 106
      iguana/iguana_recv.c
  69. 6
      iguana/iguana_secp.c
  70. 62
      iguana/iguana_spendvectors.c
  71. 8
      iguana/iguana_wallet.c
  72. 1
      iguana/m_LP
  73. 1
      iguana/m_clean
  74. 1
      iguana/m_js
  75. 42
      iguana/m_notary
  76. 1
      iguana/m_osx
  77. 1
      iguana/m_pnacl
  78. 1
      iguana/m_win32
  79. 1
      iguana/m_win64
  80. 12
      iguana/main.c
  81. 3
      iguana/notaries.h
  82. 10
      iguana/pangea_hand.c
  83. 1
      iguana/tests/DEX
  84. 1
      iguana/tests/DEXtx
  85. 1
      iguana/tests/HOT
  86. 1
      iguana/tests/HOTtx
  87. 1
      iguana/tests/LPinit
  88. 1
      iguana/tests/PAX
  89. 1
      iguana/tests/PoS
  90. 1
      iguana/tests/accept
  91. 1
      iguana/tests/activehandle
  92. 1
      iguana/tests/addmultisig
  93. 1
      iguana/tests/addnode
  94. 1
      iguana/tests/addnode2
  95. 1
      iguana/tests/addnodeSYS
  96. 1
      iguana/tests/addnotarys
  97. 1
      iguana/tests/addnotarys_7776
  98. 1
      iguana/tests/ahloop
  99. 1
      iguana/tests/allcoins
  100. 1
      iguana/tests/amlp

52
basilisk/basilisk.c

@ -773,7 +773,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende
int32_t basilisk_p2pQ_process(struct supernet_info *myinfo,int32_t maxiters)
{
struct basilisk_p2pitem *ptr; char senderip[64]; uint32_t n=0,basilisktag,len;
while ( n < maxiters && (ptr= queue_dequeue(&myinfo->p2pQ,0)) != 0 )
while ( n < maxiters && (ptr= queue_dequeue(&myinfo->p2pQ)) != 0 )
{
len = 0;
expand_ipbits(senderip,ptr->ipbits);
@ -835,7 +835,7 @@ void basilisk_p2p(struct supernet_info *myinfo,struct iguana_info *coin,struct i
ipbits = (uint32_t)calc_ipbits(senderip);
else ipbits = myinfo->myaddr.myipbits;
ptr = basilisk_p2pitem_create(coin,addr,type,ipbits,data,datalen);
queue_enqueue("p2pQ",&myinfo->p2pQ,ptr,0);
queue_enqueue("p2pQ",&myinfo->p2pQ,ptr);
}
int32_t basilisk_issued_purge(struct supernet_info *myinfo,int32_t timepad)
@ -862,6 +862,47 @@ int32_t basilisk_issued_purge(struct supernet_info *myinfo,int32_t timepad)
return(n);
}
/*#define issue_curl2(cmdstr) bitcoind_RPC(0,(char *)"curl",(char *)"http://127.0.0.1:7778",0,0,(char *)(cmdstr))
void komodo_iteration(char *symbol)
{
char *retstr,*base,*coinaddr,*txidstr,cmd[512]; uint64_t value,fiatoshis; cJSON *array,*item; int32_t i,n,vout,shortflag,height,fiatheight; bits256 txid; uint8_t rmd160[20],addrtype;
//if ( ASSETCHAINS_SYMBOL[0] == 0 )
{
sprintf(cmd,"{\"agent\":\"dpow\",\"method\":\"pending\",\"fiat\":\"%s\"}",symbol);
if ( (retstr= issue_curl2(cmd)) != 0 )
{
if ( (array= cJSON_Parse(retstr)) != 0 )
{
if ( (n= cJSON_GetArraySize(array)) > 0 )
{
for (i=0; i<n; i++)
{
item = jitem(array,i);
coinaddr = jstr(item,(char *)"address");
value = jdouble(item,(char *)"KMD") * SATOSHIDEN;
base = jstr(item,(char *)"fiat");
shortflag = juint(item,(char *)"short");
vout = jint(item,(char *)"prev_vout");
height = jint(item,(char *)"kmdheight");
fiatheight = jint(item,(char *)"height");
txidstr = jstr(item,(char *)"prev_hash");
if ( coinaddr != 0 && base != 0 && value > 0 && height > 0 )
{
fiatoshis = jdouble(item,base) * SATOSHIDEN;
decode_hex((uint8_t *)&txid,sizeof(txid),txidstr);
bitcoin_addr2rmd160(&addrtype,rmd160,coinaddr);
//komodo_gateway_deposit(coinaddr,value,shortflag,base,fiatoshis,rmd160,txid,vout,height,fiatheight);
}
}
}
}
printf("retstr.(%s)\n",retstr);
free(retstr);
}
}
}*/
void basilisks_loop(void *arg)
{
static uint32_t counter;
@ -882,13 +923,18 @@ void basilisks_loop(void *arg)
basilisk_ping_send(myinfo,relay);
counter++;
if ( (counter % 10) == 0 && myinfo->numdpows == 1 )
{
iguana_dPoWupdate(myinfo,&myinfo->DPOWS[0]);
endmilli = startmilli + 500;
}
else if ( myinfo->numdpows > 1 )
{
dp = &myinfo->DPOWS[counter % myinfo->numdpows];
iguana_dPoWupdate(myinfo,dp);
if ( (counter % myinfo->numdpows) != 0 )
iguana_dPoWupdate(myinfo,&myinfo->DPOWS[0]);
endmilli = startmilli + 200;
}
endmilli = startmilli + 500;
}
else if ( myinfo->IAMLP != 0 )
endmilli = startmilli + 1000;

4
basilisk/basilisk_MSG.c

@ -198,7 +198,7 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3
//printf("overwrite update of msg.[%d] <- datalen.%d\n",msg->datalen,datalen);
memcpy(msg->data,data,datalen);
if ( sendping != 0 )
queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL,0);
queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL);
}
portable_mutex_unlock(&myinfo->messagemutex);
return(clonestr("{\"result\":\"message updated\"}"));
@ -223,7 +223,7 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3
//if ( myinfo->NOTARY.RELAYID >= 0 )
// dpow_handler(myinfo,msg);
if ( sendping != 0 )
queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL,0);
queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL);
return(clonestr("{\"result\":\"message added to hashtable\"}"));
}

2
basilisk/basilisk_ping.c

@ -143,7 +143,7 @@ int32_t basilisk_ping_processMSG(struct supernet_info *myinfo,uint32_t senderipb
int32_t basilisk_ping_genMSG(struct supernet_info *myinfo,uint8_t *data,int32_t maxlen)
{
struct basilisk_message *msg; int32_t datalen = 0;
if ( maxlen > sizeof(msg->key) && (msg= queue_dequeue(&myinfo->msgQ,0)) != 0 ) // oneshot ping
if ( maxlen > sizeof(msg->key) && (msg= queue_dequeue(&myinfo->msgQ)) != 0 ) // oneshot ping
{
data[datalen++] = 1;
data[datalen++] = msg->keylen;

10
crypto777/OS_portable.h

@ -133,6 +133,8 @@ int32_t hseek(HUFF *hp,int32_t offset,int32_t mode);
struct allocitem { uint32_t allocsize,type; } PACKED;
struct queueitem { struct queueitem *next,*prev; uint32_t allocsize,type; } PACKED;
struct stritem { struct queueitem DL; char str[]; };
typedef struct queue
{
struct queueitem *list;
@ -249,14 +251,14 @@ void OS_randombytes(uint8_t *x,long xlen);
long myallocated(uint8_t type,long change);
void *mycalloc(uint8_t type,int32_t n,long itemsize);
void myfree(void *_ptr,long allocsize);
void free_queueitem(void *itemdata);
//void free_queueitem(void *itemdata);
void *myrealloc(uint8_t type,void *oldptr,long oldsize,long newsize);
void *myaligned_alloc(uint64_t allocsize);
int32_t myaligned_free(void *ptr,long size);
void *queueitem(char *str);
void queue_enqueue(char *name,queue_t *queue,struct queueitem *origitem,int32_t offsetflag);
void *queue_dequeue(queue_t *queue,int32_t offsetflag);
struct queueitem *queueitem(char *str);
void queue_enqueue(char *name,queue_t *queue,struct queueitem *origitem);//,int32_t offsetflag);
void *queue_dequeue(queue_t *queue);//,int32_t offsetflag);
void *queue_delete(queue_t *queue,struct queueitem *copy,int32_t copysize,int32_t freeitem);
void *queue_free(queue_t *queue);
void *queue_clone(queue_t *clone,queue_t *queue,int32_t size);

2
crypto777/bitcoind_RPC.c

@ -134,7 +134,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *
specialcase = 1;
else specialcase = 0;
if ( url[0] == 0 )
strcpy(url,"http://127.0.0.1:7876/nxt");
strcpy(url,"http://127.0.0.1:7776");
if ( specialcase != 0 && 0 )
printf("<<<<<<<<<<< bitcoind_RPC: debug.(%s) url.(%s) command.(%s) params.(%s)\n",debugstr,url,command,params);
try_again:

143
crypto777/iguana_OS.c

@ -41,7 +41,7 @@ void OS_randombytes(unsigned char *x,long xlen)
{
OS_portable_randombytes(x,xlen);
}
static double _kb(double n) { return(n / 1024.); }
static double _mb(double n) { return(n / (1024.*1024.)); }
static double _gb(double n) { return(n / (1024.*1024.*1024.)); }
@ -94,6 +94,7 @@ long myallocated(uint8_t type,long change)
void *mycalloc(uint8_t type,int32_t n,long itemsize)
{
#ifdef USE_MYCALLOC
//static portable_mutex_t MEMmutex;
struct allocitem *item; int64_t allocsize = ((uint64_t)n * itemsize);
if ( type == 0 && n == 0 && itemsize == 0 )
@ -115,30 +116,39 @@ void *mycalloc(uint8_t type,int32_t n,long itemsize)
item->type = type;
//portable_mutex_unlock(&MEMmutex);
return((void *)((long)item + sizeof(*item)));
#else
return(calloc(n,itemsize));
#endif
}
void *queueitem(char *str)
struct queueitem *queueitem(char *str)
{
struct queueitem *item; int32_t n,allocsize; char *data; uint8_t type = 'y';
//portable_mutex_lock(&MEMmutex);
n = (uint32_t)strlen(str) + 1;
allocsize = (uint32_t)(sizeof(struct queueitem) + n);
myallocated(type,allocsize);
while ( (item= calloc(1,allocsize)) == 0 )
{
char str[65];
printf("queueitem: need to wait for memory.(%d,%ld) %s to be available\n",n,(long)sizeof(*item),mbstr(str,allocsize));
sleep(1);
}
item->allocsize = (uint32_t)allocsize;
item->type = type;
data = (void *)(long)((long)item + sizeof(*item));
memcpy(data,str,n);
//printf("(%c) queueitem.%p itemdata.%p n.%d allocsize.%d\n",type,item,data,n,allocsize);
//portable_mutex_unlock(&MEMmutex);
return(data);
/*struct queueitem *item; int32_t n,allocsize; char *data; uint8_t type = 'y';
//portable_mutex_lock(&MEMmutex);
n = (uint32_t)strlen(str) + 1;
allocsize = (uint32_t)(sizeof(struct queueitem) + n);
myallocated(type,allocsize);
while ( (item= calloc(1,allocsize)) == 0 )
{
char str[65];
printf("queueitem: need to wait for memory.(%d,%ld) %s to be available\n",n,(long)sizeof(*item),mbstr(str,allocsize));
sleep(1);
}
item->allocsize = (uint32_t)allocsize;
item->type = type;
data = (void *)(long)((long)item + sizeof(*item));
memcpy(data,str,n);
//printf("(%c) queueitem.%p itemdata.%p n.%d allocsize.%d\n",type,item,data,n,allocsize);
//portable_mutex_unlock(&MEMmutex);
return(data);*/
struct stritem *sitem; int32_t len;
len = (int32_t)strlen(str);
sitem = calloc(1,sizeof(*sitem) + len + 16);
memcpy(sitem->str,str,len);
return(&sitem->DL);
}
#ifdef USE_MYCALLOC
void _myfree(uint8_t type,int32_t origallocsize,void *origptr,int32_t allocsize)
{
//portable_mutex_lock(&MEMmutex);
@ -171,12 +181,12 @@ void myfree(void *_ptr,long allocsize)
_myfree(item->type,item->allocsize,item,(uint32_t)allocsize);
}
void free_queueitem(void *itemdata)
{
struct queueitem *item = (void *)((long)itemdata - sizeof(struct queueitem));
//printf("freeq item.%p itemdata.%p size.%d\n",item,itemdata,item->allocsize);
_myfree(item->type,item->allocsize,item,item->allocsize);
}
/*void free_queueitem(void *itemdata)
{
struct queueitem *item = (void *)((long)itemdata - sizeof(struct queueitem));
//printf("freeq item.%p itemdata.%p size.%d\n",item,itemdata,item->allocsize);
_myfree(item->type,item->allocsize,item,item->allocsize);
}*/
void *myrealloc(uint8_t type,void *oldptr,long oldsize,long newsize)
{
@ -190,6 +200,17 @@ void *myrealloc(uint8_t type,void *oldptr,long oldsize,long newsize)
}
return(newptr);
}
#else
void myfree(void *_ptr,long allocsize)
{
free(_ptr);
}
void *myrealloc(uint8_t type,void *oldptr,long oldsize,long newsize)
{
return(realloc(oldptr,newsize));
}
#endif
static uint64_t _align16(uint64_t ptrval) { if ( (ptrval & 15) != 0 ) ptrval += 16 - (ptrval & 15); return(ptrval); }
@ -235,25 +256,20 @@ void lock_queue(queue_t *queue)
portable_mutex_lock(&queue->mutex);
}
void queue_enqueue(char *name,queue_t *queue,struct queueitem *origitem,int32_t offsetflag)
void queue_enqueue(char *name,queue_t *queue,struct queueitem *item)//,int32_t offsetflag)
{
struct queueitem *item;
//struct queueitem *item;
if ( queue->name[0] == 0 && name != 0 && name[0] != 0 )
strcpy(queue->name,name);//,sizeof(queue->name));
if ( origitem == 0 )
{
printf("FATAL type error: queueing empty value\n");//, getchar();
return;
}
//fprintf(stderr,"enqueue.(%s) %p offset.%d\n",queue->name,origitem,offsetflag);
//fprintf(stderr,"enqueue.(%s) %p\n",queue->name,item);
lock_queue(queue);
item = (struct queueitem *)((long)origitem - offsetflag*sizeof(struct queueitem));
//item = (struct queueitem *)((long)origitem - offsetflag*sizeof(struct queueitem));
DL_APPEND(queue->list,item);
portable_mutex_unlock(&queue->mutex);
//printf("queue_enqueue name.(%s) origitem.%p append.%p list.%p\n",name,origitem,item,queue->list);
}
void *queue_dequeue(queue_t *queue,int32_t offsetflag)
void *queue_dequeue(queue_t *queue)//,int32_t offsetflag)
{
struct queueitem *item = 0;
lock_queue(queue);
@ -264,9 +280,10 @@ void *queue_dequeue(queue_t *queue,int32_t offsetflag)
DL_DELETE(queue->list,item);
}
portable_mutex_unlock(&queue->mutex);
if ( item != 0 && offsetflag != 0 )
return((void *)((long)item + sizeof(struct queueitem)));
else return(item);
//if ( item != 0 && offsetflag != 0 )
// return((void *)((long)item + sizeof(struct queueitem)));
//else
return(item);
}
void *queue_delete(queue_t *queue,struct queueitem *copy,int32_t copysize,int32_t freeitem)
@ -321,7 +338,7 @@ void *queue_clone(queue_t *clone,queue_t *queue,int32_t size)
{
ptr = mycalloc('c',1,sizeof(*ptr));
memcpy(ptr,item,size);
queue_enqueue(queue->name,clone,ptr,0);
queue_enqueue(queue->name,clone,ptr);
}
//printf("name.(%s) dequeue.%p list.%p\n",queue->name,item,queue->list);
}
@ -543,8 +560,8 @@ void OS_remove_directory(char *dirname)
OS_removefile(buf,0);
fclose(fp);
}
//printf("skip rmdir.(%s)\n",dirname);
return;
//printf("skip rmdir.(%s)\n",dirname);
return;
sprintf(buf,"rmdir %s",dirname);
if ( system(buf) != 0 )
{
@ -876,14 +893,14 @@ void *OS_mapfile(char *fname,long *filesizep,int32_t enablewrite) // win and pna
}
/*int32_t OS_syncmap(struct OS_mappedptr *mp,long len) // pnacl doesnt implement sync
{
return(OS_portable_syncmap(mp,len));
}
void *OS_tmpalloc(char *dirname,char *name,struct OS_memspace *mem,long origsize) // no syncmap no tmpalloc
{
return(OS_portable_tmpalloc(dirname,name,mem,origsize));
}*/
{
return(OS_portable_syncmap(mp,len));
}
void *OS_tmpalloc(char *dirname,char *name,struct OS_memspace *mem,long origsize) // no syncmap no tmpalloc
{
return(OS_portable_tmpalloc(dirname,name,mem,origsize));
}*/
void OS_init()
{
@ -934,19 +951,19 @@ int32_t OS_getline(int32_t waitflag,char *line,int32_t max,char *dispstr)
//////////// test suite for:
/*
int64_t OS_filesize(char *fname);
void OS_ensure_directory(char *dirname);
long OS_ensurefilesize(char *fname,long filesize,int32_t truncateflag);
int32_t OS_truncate(char *fname,long filesize);
int32_t OS_renamefile(char *fname,char *newfname);
int32_t OS_removefile(char *fname,int32_t scrubflag);
void *OS_mapfile(char *fname,long *filesizep,int32_t enablewrite);
int32_t OS_releasemap(void *ptr,uint64_t filesize);
double OS_milliseconds();
void OS_randombytes(uint8_t *x,long xlen);
*/
int64_t OS_filesize(char *fname);
void OS_ensure_directory(char *dirname);
long OS_ensurefilesize(char *fname,long filesize,int32_t truncateflag);
int32_t OS_truncate(char *fname,long filesize);
int32_t OS_renamefile(char *fname,char *newfname);
int32_t OS_removefile(char *fname,int32_t scrubflag);
void *OS_mapfile(char *fname,long *filesizep,int32_t enablewrite);
int32_t OS_releasemap(void *ptr,uint64_t filesize);
double OS_milliseconds();
void OS_randombytes(uint8_t *x,long xlen);
*/
int32_t iguana_OStests()
{

16
crypto777/iguana_utils.c

@ -263,12 +263,12 @@ int32_t iguana_numthreads(struct iguana_info *coin,int32_t mask)
void iguana_launcher(void *ptr)
{
struct iguana_thread *t = ptr; struct iguana_info *coin;
coin = t->coin;
struct iguana_thread *t = ptr; //struct iguana_info *coin;
//coin = t->coin;
t->funcp(t->arg);
if ( coin != 0 )
coin->Terminated[t->type % (sizeof(coin->Terminated)/sizeof(*coin->Terminated))]++;
queue_enqueue("TerminateQ",&TerminateQ,&t->DL,0);
//if ( coin != 0 )
// coin->Terminated[t->type % (sizeof(coin->Terminated)/sizeof(*coin->Terminated))]++;
queue_enqueue("TerminateQ",&TerminateQ,&t->DL);
}
void iguana_terminate(struct iguana_thread *t)
@ -296,7 +296,7 @@ struct iguana_thread *iguana_launch(struct iguana_info *coin,char *name,iguana_f
retval = OS_thread_create(&t->handle,NULL,(void *)iguana_launcher,(void *)t);
if ( retval != 0 )
printf("error launching %s\n",t->name);
while ( (t= queue_dequeue(&TerminateQ,0)) != 0 )
while ( (t= queue_dequeue(&TerminateQ)) != 0 )
{
if ( (rand() % 100000) == 0 && coin != 0 )
printf("terminated.%d launched.%d terminate.%p\n",coin->Terminated[t->type],coin->Launched[t->type],t);
@ -359,11 +359,13 @@ int32_t decode_hex(unsigned char *bytes,int32_t n,char *hex)
{
int32_t adjust,i = 0;
//printf("decode.(%s)\n",hex);
if ( is_hexstr(hex,n) == 0 )
if ( is_hexstr(hex,n) <= 0 )
{
memset(bytes,0,n);
return(n);
}
if ( hex[n-1] == '\n' || hex[n-1] == '\r' )
hex[--n] = 0;
if ( n == 0 || (hex[n*2+1] == 0 && hex[n*2] != 0) )
{
if ( n > 0 )

4
datachain/datachain.c

@ -323,11 +323,11 @@ int64_t datachain_update(struct supernet_info *myinfo,int32_t ordered,struct igu
if ( memcmp(rmd160,CRYPTO777_RMD160,20) == 0 )
{
crypto777_payment += value;
printf("datachain_update crypto777 %.8f += %.8f\n",dstr(crypto777_payment),dstr(value));
//printf("datachain_update crypto777 %.8f += %.8f\n",dstr(crypto777_payment),dstr(value));
}
else if ( crypto777_payment != 0 && (type == IGUANA_SCRIPT_OPRETURN || type == IGUANA_SCRIPT_3of3 || type == IGUANA_SCRIPT_2of2 || type == IGUANA_SCRIPT_1of1) )
{
printf("datachain_update opreturn\n");
//printf("datachain_update opreturn\n");
iguana_opreturn(myinfo,ordered,coin,timestamp,bp,crypto777_payment,height,hdrsi_unspentind,value,fileid,scriptpos,scriptlen);
} else datachain_update_spend(myinfo,ordered,coin,timestamp,bp,height,txid,vout,rmd160,value);
return(crypto777_payment);

21
deprecated/obsolete.h

@ -19636,3 +19636,24 @@ len = 0;
}
free(retstr);
}
/*pthread_mutex_lock(&komodo_mutex);
tmp = 0;
if ( PAX != 0 )
{
pax = (struct pax_transaction *)PAX->hh.next;
while ( pax != 0 && pax != tmp && n++ < 1000000 )
{
printf("PAX.[%p %p] pax.%p marked.%d fiat %.8f KMD %.8f\n",PAX->hh.next,PAX->hh.prev,pax,pax->marked,dstr(pax->fiatoshis),dstr(pax->komodoshis));
if ( pax->marked == 0 )
{
if ( komodo_is_issuer() != 0 )
total += pax->fiatoshis;
else total += pax->komodoshis;
}
tmp = pax;
pax = (struct pax_transaction *)pax->hh.next;
}
}
pthread_mutex_unlock(&komodo_mutex);
if ( n >= 1000000 )
printf("komodo_paxtotal n.%d iterations?\n",n);*/

2
gecko/gecko_blocks.c

@ -132,7 +132,7 @@ int32_t gecko_hwmset(struct supernet_info *myinfo,struct iguana_info *virt,struc
printf("no bundle for %s.%d\n",virt->symbol,block->height);
return(-1);
}
if ( iguana_ramchain_data(myinfo,virt,addr,txdata,txarray,block->RO.txn_count,data,datalen,bp,block) >= 0 )
if ( iguana_ramchain_data(myinfo,virt,addr,txdata,txarray,block->RO.txn_count,data,datalen,bp,block,0) >= 0 )
{
block->fpipbits = (uint32_t)addr->ipbits;
block->RO.recvlen = datalen;

1
iguana/coins/allofus

@ -1,3 +1,4 @@
#!/bin/bash
../agents/iguana coins/genbtcd.json &
sleep 5
../agents/iguana coins/genbtc.json &

1
iguana/coins/basilisk

@ -1,3 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632}"
curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":5,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":8333}"
#curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":0,\"VALIDATE\":0,\"prefetchlag\":11,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"newcoin\":\"LTC\",\"name\":\"Litecoin\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"fbc0b6db\",\"p2p\":9333,\"rpc\":9334,\"pubval\":48,\"p2shval\":5,\"wifval\":176,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2\",\"genesis\":{\"version\":1,\"timestamp\":1317972665,\"nBits\":\"1e0ffff0\",\"nonce\":2084524493,\"merkle_root\":\"97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9\"},\"alertpubkey\":\"040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9\",\"protover\":70002}"

4
iguana/coins/btc

@ -1 +1,3 @@
curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"root/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}"
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"${HOME#"/"}/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}"

3
iguana/coins/btc_7776

@ -1 +1,2 @@
curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"root/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}"
#!/bin/bash
curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"${HOME#"/"}/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}"

1
iguana/coins/fastbtcd

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":4096,\"endpend\":4096,\"services\":129,\"maxpeers\":256,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632}"

3
iguana/coins/genNAME

@ -0,0 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"NAME\",\"name\":\"NAME\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"a06210d8\",\"p2p\":15233,\"rpc\":15234,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}"

1
iguana/coins/genanc

@ -1 +1,2 @@
#!/bin/bash
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\":\"ANC\",\"name\":\"AnonCoin\",\"netmagic\":\"facabada\",\"p2p\":9377,\"rpc\":28332,\"pubval\":23,\"p2shval\":5,\"wifval\":151,\"txfee_satoshis\":\"2000000\",\"minconfirms\":2,\"genesishash\":\"00000be19c5a519257aa921349037d55548af7cabf112741eb905a26bb73e468\",\"genesis\":{\"version\":1,\"timestamp\":1370190760,\"nBits\":\"1e0ffff0\",\"nonce\":347089008,\"merkle_root\":\"7ce7004d764515f9b43cb9f07547c8e2e00d94c9348b3da33c8681d350f2c736\"},\"alertpubkey\":\"04c6db35c11724e526f6725cc5bd5293b4bc9382397856e1bcef7111fb44ce357fd12442b34c496d937a348c1dca1e36ae0c0e128905eb3d301433887e8f0b4536\",\"protover\":70010}"

1
iguana/coins/genblk

@ -1 +1,2 @@
#!/bin/bash
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\":\"BLK\",\"name\":\"BlackCoin\",\"netmagic\":\"70352205\",\"p2p\":15714,\"rpc\":15715,\"pubval\":25,\"p2shval\":85,\"wifval\":153,\"txfee_satoshis\":\"10000\",\"minconfirms\":2,\"genesishash\":\"000001faef25dec4fbcf906e6242621df2c183bf232f263d0ba5b101911e4563\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1393221600,\"nBits\":\"1e0fffff\",\"nonce\":164482,\"merkle_root\":\"12630d16a97f24b287c8c2594dda5fb98c9e6c70fc61d44191931ea2aa08dc90\"},\"alertpubkey\":\"0486bce1bac0d543f104cbff2bd23680056a3b9ea05e1137d2ff90eeb5e08472eb500322593a2cb06fbf8297d7beb6cd30cb90f98153b5b7cce1493749e41e0284\",\"isPoS\":1,\"debug\":1}"

1
iguana/coins/genbtc

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":8333,\"minconfirms\":1}"

1
iguana/coins/genbtcd

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

1
iguana/coins/genbtcdsigs

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":8,\"endpend\":4,\"services\":129,\"maxpeers\":64,\"RELAY\":1,\"VALIDATE\":2,\"portp2p\":14631,\"rpc\":14632}"

1
iguana/coins/genbtm

@ -1 +1,2 @@
#!/bin/bash
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\":\"BTM\",\"name\":\"Bitmark\",\"netmagic\":\"f9beb4d9\",\"p2p\":9265,\"rpc\":9266,\"pubval\":85,\"p2shval\":5,\"wifval\":213,\"txfee_satoshis\":\"0\",\"minconfirms\":2,\"genesishash\":\"c1fb746e87e89ae75bdec2ef0639a1f6786744639ce3d0ece1dcf979b79137cb\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1405274442,\"nBits\":\"1d00ffff\",\"nonce\":14385103,\"merkle_root\":\"d4715adf41222fae3d4bf41af30c675bc27228233d0f3cfd4ae0ae1d3e760ba8\"},\"alertpubkey\":\"04bf5a75ff0f823840ef512b08add20bb4275ff6e097f2830ad28645e28cb5ea4dc2cfd0972b94019ad46f331b45ef4ba679f2e6c87fd19c864365fadb4f8d2269\"}"

1
iguana/coins/gencarb

@ -1 +1,2 @@
#!/bin/bash
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\":\"CARB\",\"name\":\"Carboncoin\",\"netmagic\":\"abccbbdf\",\"p2p\":9350,\"rpc\":9351,\"pubval\":47,\"p2shval\":5,\"wifval\":175,\"txfee_satoshis\":\"0\",\"minconfirms\":2,\"genesishash\":\"a94f1aae8c409a0bd1e53cbca92d7e506b61c51d955cf56f76da501718d48d6c\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1389199888,\"nBits\":\"1e0ffff0\",\"nonce\":605268,\"merkle_root\":\"074bbb9d355731bfa8f67130e2179db7518d1387ad52e55309d4debe7d4e6383\"},\"alertpubkey\":\"046d6918a7c0c053aa942dbb8861499be4bd915c8bfb6a2b77b3787e207097cc2734b9321226ff107c1a95dae98570a66baec66e350d78ceba091b54411654d33f\"}"

1
iguana/coins/gendgb

@ -1,3 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"startpend\":16,\"endpend\":8,\"services\":129,\"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\":30,\"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\"}"

1
iguana/coins/gendoge

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"startpend\":8,\"endpend\":4,\"services\":129,\"auxpow\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"DOGE\",\"name\":\"Dogecoin\",\"netmagic\":\"C0C0C0C0\",\"p2p\":22556,\"rpc\":22555,\"pubval\":30,\"p2shval\":5,\"wifval\":128,\"txfee_satoshis\":\"100000000\",\"minconfirms\":2,\"genesishash\":\"1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691\",\"genesis\":{\"hashalgo\": \"scrypt\",\"version\":1,\"timestamp\":1386325540,\"nBits\":\"1e0ffff0\",\"nonce\":99943,\"merkle_root\":\"5b2a3f53f605d62c53e62932dac6925e3d74afa5a4b459745c36d42d0ed26a69\"},\"alertpubkey\":\"04d4da7a5dae4db797d9b0644d57a5cd50e05a70f36091cd62e2fc41c98ded06340be5a43a35e185690cd9cde5d72da8f6d065b499b06f51dcfba14aad859f443a\"}"

1
iguana/coins/geneac

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"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\"}"

1
iguana/coins/genfrk

@ -1 +1,2 @@
#!/bin/bash
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\":\"FRK\",\"name\":\"Franko\",\"netmagic\":\"7defaced\",\"p2p\":7912,\"rpc\":7913,\"pubval\":35,\"p2shval\":5,\"wifval\":163,\"txfee_satoshis\":\"0\",\"minconfirms\":2,\"genesishash\":\"19225ae90d538561217b5949e98ca4964ac91af39090d1a4407c892293e4f44f\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1368144664,\"nBits\":\"1e0ffff0\",\"nonce\":731837,\"merkle_root\":\"b78f79f1d10029cc45ed3d5a1db7bd423d4ee170c03baf110a62565d16a21dca\"},\"alertpubkey\":\"04d4da7a5dae4db797d9b0644d57a5cd50e05a70f36091cd62e2fc41c98ded06340be5a43a35e185690cd9cde5d72da8f6d065b499b06f51dcfba14aad859f443a\"}"

1
iguana/coins/gengmc

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"startpend\":8,\"endpend\":4,\"services\":129,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"GMC\",\"name\":\"GameCredits\",\"netmagic\":\"fbc0b6db\",\"p2p\":40002,\"rpc\":40001,\"pubval\":38,\"p2shval\":5,\"wifval\":166,\"txfee_satoshis\":\"100000\",\"minconfirms\":2,\"genesishash\":\"91ec5f25ee9a0ffa1af7d4da4db9a552228dd2dc77cdb15b738be4e1f55f30ee\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1392757140,\"nBits\":\"1e0ffff0\",\"nonce\":2084565393,\"merkle_root\":\"d849db99a14164f4b4c8ad6d2d8d7e2b1ba7f89963e9f4bf9fad5ff1a4754429\"},\"alertpubkey\":\"04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284\",\"auxpow\":1,\"protover\":80006,\"isPoS\":0,\"fixit\":0}"

4
iguana/coins/genkmd

@ -1,2 +1,4 @@
curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":129,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}"
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}"

2
iguana/coins/genltc

@ -1,2 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":68,\"endpend\":68,\"services\":129,\"maxpeers\":256,\"newcoin\":\"LTC\",\"name\":\"Litecoin\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"fbc0b6db\",\"p2p\":9333,\"rpc\":9332,\"pubval\":48,\"p2shval\":5,\"wifval\":176,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2\",\"genesis\":{\"version\":1,\"timestamp\":1317972665,\"nBits\":\"1e0ffff0\",\"nonce\":2084524493,\"merkle_root\":\"97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9\"},\"alertpubkey\":\"040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9\",\"protover\":70002}"

2
iguana/coins/genmzc

@ -1 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"MZC\",\"name\":\"MazaCoin\",\"netmagic\":\"f8b503df\",\"p2p\":12835,\"rpc\":12832,\"pubval\":50,\"p2shval\":9,\"wifval\":224,\"txfee_satoshis\":\"0\",\"minconfirms\":2,\"genesishash\":\"00000c7c73d8ce604178dae13f0fc6ec0be3275614366d44b1b4b5c6e238c60c\",\"genesis\":{\"version\":1,\"timestamp\":1390747675,\"nBits\":\"1e0ffff0\",\"nonce\":2091390249,\"merkle_root\":\"62d496378e5834989dd9594cfc168dbb76f84a39bbda18286cddc7d1d1589f4f\"},\"alertpubkey\":\"04f09702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284\"}"

2
iguana/coins/gennmc

@ -1 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"NMC\",\"active\":1,\"maxpeers\":128,\"services\":129,\"poll\":1,\"minconfirms\":3,\"estblocktime\":600,\"txfee_satoshis\":500000,\"useaddmultisig\":1,\"hastimestamp\":0,\"pubval\":\"00\",\"scriptval\":\"05\",\"wiftype\":\"80\",\"netmagic\":\"fba4c795\",\"genesishash\":\"000000000062b72c5e2ceb45fbc8587e807c155b0da735e6483dfba2f0a9c770\",\"genesis\":{\"hashalgo\":\"sha256\",\"version\":1,\"timestamp\":1303000001,\"nbits\":\"1c007fff\",\"nonce\":2719916434,\"merkle_root\":\"41c62dbd9068c89a449525e3cd5ac61b20ece28c3c38b3f35b2161f0e6d3cb0d\"},\"p2p\":8334,\"rpc\":8836}"

2
iguana/coins/gennotary

@ -1 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7776" --data "{\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"NOTARY\",\"services\":129,\"maxpeers\":2048,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":7775,\"rpc\":0}"

2
iguana/coins/gensys

@ -1,2 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":18,\"endpend\":18,\"services\":129,\"maxpeers\":256,\"newcoin\":\"SYS\",\"name\":\"SYScoin\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"f9beb4d9\",\"p2p\":8369,\"rpc\":8370,\"pubval\":0,\"p2shval\":5,\"wifval\":128,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"0000072d66e51ab87de265765cc8bdd2d229a4307c672a1b3d5af692519cf765\",\"genesis\":{\"version\":1,\"timestamp\":1450473723,\"nBits\":\"1e0ffff0\",\"nonce\":5258726,\"merkle_root\":\"5215c5a2af9b63f2550b635eb2b354bb13645fd8fa31275394eb161944303065\"},\"protover\":70012,\"auxpow\":1,\"fixit\":0}"

2
iguana/coins/gentaz

@ -1,2 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"TAZ\",\"name\":\"Test Zcash\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"a5f1e726\",\"p2p\":18233,\"rpc\":18232,\"pubval\":111,\"p2shval\":196,\"wifval\":239,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"0cdf00b25a93ded11d73ebe1728cf7867f18e1f62aca9554b95e0f3026174e33\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a0000000000000000000000000000000000000000000000000000000000000000dae5494d0f0f0f200900000000000000000000000000000000000000000000000000000000000000fd4005003423da3e41f916bf3ff0ee770eb844a240361abe08a8c9d46bd30226e2ad411a4047b6ddc230d173c60537e470e24f764120f5a2778b2a1285b0727bf79a0b085ad67e6266fb38fd72ef17f827315c42f921720248c983d4100e6ebd1c4b5e8762a973bac3bec7f7153b93752ebbb465f0fc9520bcfc30f9abfe303627338fed6ede9cf1b9173a736cf270cf4d9c6999ff4c3a301a78fd50dab6ccca67a0c5c2e41f216a1f3efd049a74bbe6252f9773bc309d3f9e554d996913ce8e1cec672a1fa4ea59726b61ea9e75d5ce9aa5dbfa96179a293810e02787f26de324fe7c88376ff57e29574a55faff7c2946f3e40e451861c32bf67da7377de3136858a18f34fab1bc8da37726ca2c25fc7b312a5427554ec944da81c7e27255d6c94ade9987ff7daedc2d1cc63d7d4cf93e691d13326fb1c7ee72ccdc0b134eb665fc6a9821e6fef6a6d45e4aac6dca6b505a0100ad56ea4f6fa4cdc2f0d1b65f730104a515172e34163bdb422f99d083e6eb860cf6b3f66642c4dbaf0d0fa1dca1b6166f1d1ffaa55a9d6d6df628afbdd14f1622c1c8303259299521a253bc28fcc93676723158067270fc710a09155a1e50c533e9b79ed5edba4ab70a08a9a2fc0eef0ddae050d75776a9804f8d6ad7e30ccb66c6a98d86710ca7a4dfb4feb159484796b9a015c5764aa3509051c87f729b9877ea41f8b470898c01388ed9098b1e006d3c30fc6e7c781072fa3f75d918505ee8ca75840fc62f67c57060666aa42578a2dd022eda62e3f1e447d7364074d34fd60ad9b138f60422afa6cfcb913fd6c213b496144dbfda7bfc7c24540cfe40ad0c0fd5a8c0902127f53d3178ba1b2a87bf1224d53d3a15e49ccdf121ae872a011c996d1b9793153cdcd4c0a7e99f8a35669788551cca2b62769eda24b6b55e2f4e0ac0d30aa50ecf33c6cdb24adfc922006a7bf434ced800fefe814c94c6fc8caa37b372d5088bb31d2f6b11a7a67ad3f70abbac0d5c256b637828de6cc525978cf151a2e50798e0c591787639a030291272c9ced3ab7d682e03f8c7db51f60163baa85315789666ea8c5cd6f789a7f4a5de4f8a9dfefce20f353cec606492fde8eab3e3b487b3a3a57434f8cf252a4b643fc125c8a5948b06744f5dc306aa587bdc85364c7488235c6edddd78763675e50a9637181519be06dd30c4ba0d845f9ba320d01706fd6dd64d1aa3cd4211a4a7d1d3f2c1ef2766d27d5d2cdf8e7f5e3ea309d4f149bb737305df1373a7f5313abe5986f4aa620bec4b0065d48aafac3631de3771f5c4d2f6eec67b09d9c70a3c1969fecdb014cb3c69832b63cc9d6efa378bff0ef95ffacdeb1675bb326e698f022c1a3a2e1c2b0f05e1492a6d2b7552388eca7ee8a2467ef5d4207f65d4e2ae7e33f13eb473954f249d7c20158ae703e1accddd4ea899f026618695ed2949715678a32a153df32c08922fafad68b1895e3b10e143e712940104b3b352369f4fe79bd1f1dbe03ea9909dbcf5862d1f15b3d1557a6191f54c891513cdb3c729bb9ab08c0d4c35a3ed67d517ffe1e2b7a798521aed15ff9822169c0ec860d7b897340bc2ef4c37f7eb73bd7dafef12c4fd4e6f5dd3690305257ae14ed03df5e3327b68467775a90993e613173fa6650ffa2a26e84b3ce79606bf234eda9f4053307f344099e3b10308d3785b8726fd02d8e94c2759bebd05748c3fe7d5fe087dc63608fb77f29708ab167a13f32da251e249a544124ed50c270cfc6986d9d1814273d2f0510d0d2ea335817207db6a4a23ae9b079967b63b25cb3ceea7001b65b879263f5009ac84ab89738a5b8b71fd032beb9f297326f1f5afa630a5198d684514e242f315a4d95fa6802e82799a525bb653b80b4518ec610a5996403b1391\",\"debug\":0}"

2
iguana/coins/genuno

@ -1 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"auxpow\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"UNO\",\"name\":\"Unobtanium\",\"netmagic\":\"03d5b503\",\"p2p\":65534,\"rpc\":65535,\"pubval\":130,\"p2shval\":30,\"wifval\":224,\"txfee_satoshis\":\"1000000\",\"minconfirms\":2,\"genesishash\":\"000004c2fc5fffb810dccc197d603690099a68305232e552d96ccbe8e2c52b75\",\"genesis\":{\"version\":1,\"timestamp\":1375548986,\"nBits\":\"1e0fffff\",\"nonce\":1211565,\"merkle_root\":\"36a192e90f70131a884fe541a1e8a5643a28ba4cb24cbb2924bd0ee483f7f484\"},\"alertpubkey\":\"04fd68acb6a895f3462d91b43eef0da845f0d531958a858554feab3ac330562bf76910700b3f7c29ee273ddc4da2bb5b953858f6958a50e8831eb43ee30c32f21d\"}"

2
iguana/coins/genvia

@ -1,2 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"startpend\":4,\"endpend\":4,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"VIA\",\"name\":\"Viacoin\",\"netmagic\":\"0f68c6cb\",\"p2p\":5223,\"rpc\":38332,\"pubval\":71,\"p2shval\":33,\"wifval\":199,\"txfee_satoshis\":\"100000\",\"minconfirms\":2,\"genesishash\":\"4e9b54001f9976049830128ec0331515eaabe35a70970d79971da1539a400ba1\",\"genesis\":{\"version\":1,\"timestamp\":1405164774,\"nBits\":\"1e01ffff\",\"nonce\":4016033,\"merkle_root\":\"0317d32e01a2adf6f2ac6f58c7cdaab6c656edc6fdb45986c739290053275200\"},\"alertpubkey\":\"047885d9f6c0cf9e918d04634d4dd696cf172763f1975aad099daddca3f3c712c98754eae293b36484055e0d414800e519f5a342e56e09217faf07abff5bd96507\"}"

2
iguana/coins/genvpn

@ -1 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":256,\"newcoin\":\"VPN\",\"name\":\"VPNcoin\",\"hasheaders\":1,\"useaddmultisig\":0,\"isPoS\":1,\"minoutput\":10000,\"minconfirms\":2,\"txfee_satoshis\":\"10000\",\"genesishash\":\"00000ac7d764e7119da60d3c832b1d4458da9bc9ef9d5dd0d91a15f690a46d99\",\"genesis\":{\"version\":1,\"timestamp\":1409839200,\"nBits\":\"1e0fffff\",\"nonce\":64881664,\"merkle_root\":\"698a93a1cacd495a7a4fb3864ad8d06ed4421dedbc57f9aaad733ea53b1b5828\"},\"protover\":70002,\"netmagic\":\"fbc0b6db\",\"p2p\":1920,\"rpc\":1921,\"pubval\":71,\"p2shval\":5,\"wifval\":199}"

2
iguana/coins/genvrc

@ -1 +1,3 @@
#!/bin/bash
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\":\"VRC\",\"name\":\"VeriCoin\",\"netmagic\":\"70352205\",\"p2p\":58684,\"rpc\":58683,\"pubval\":70,\"p2shval\":132,\"wifval\":153,\"txfee_satoshis\":\"10000\",\"minconfirms\":10,\"genesishash\":\"000004da58a02be894a6c916d349fe23cc29e21972cafb86b5d3f07c4b8e6bb8\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1399690945,\"nBits\":\"1e0fffff\",\"nonce\":612416,\"merkle_root\":\"60424046d38de827de0ed1a20a351aa7f3557e3e1d3df6bfb34a94bc6161ec68\"},\"alertpubkey\":\"047eba500c7134efcaf721e9f438f25b948ceaa5f059b877b3a64f6fa2cf0ea6f41091bd9b1ff9448727db97e4ad44d49496dc41949c677c49fe632d1d7996a515\",\"isPoS\":1,\"debug\":1}"

2
iguana/coins/genzcash

@ -1,2 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"6df6e755\",\"p2p\":18333,\"rpc\":18332,\"pubval\":111,\"p2shval\":196,\"wifval\":239,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"27d1f4ce03fc473c9dd6e1e307c682c8f802eae1f5a2f61402aa1ae8702ed3b6\",\"protover\":70002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4adae5494dffff7f200000000000000000000000000000000000000000000000000000000000000000209d0900001dc600004fba000024e20100e5660000778100007e190100222f0100720e000056e50100eb12010089920100583d00002e660000844e01001bfe0100cf0c0000892a0000f5230000f9680000976e00009b7b000046770000afd80100bd0d000057650000048f000082b100006a2500004e0601006fef000048410100\"}"

4
iguana/coins/genzec

@ -1 +1,3 @@
curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"24e92764\",\"p2p\":8233,\"rpc\":8232,\"pubval\":184,\"p2shval\":189,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08\",\"protover\":170002,\"genesisblock\":\"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157\",\"debug\":0}"
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"path\":\"${HOME#"/"}/.path\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"24e92764\",\"p2p\":8233,\"rpc\":8232,\"pubval\":184,\"p2shval\":189,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08\",\"protover\":170002,\"genesisblock\":\"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157\",\"debug\":0}"

2
iguana/coins/genzet

@ -1 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"ZET\",\"name\":\"Zetacoin\",\"netmagic\":\"fab503df\",\"p2p\":17333,\"rpc\":17335,\"pubval\":80,\"p2shval\":9,\"wifval\":224,\"txfee_satoshis\":\"10000\",\"minconfirms\":2,\"genesishash\":\"000006cab7aa2be2da91015902aa4458dd5fbb8778d175c36d429dc986f2bff4\",\"genesis\":{\"version\":1,\"timestamp\":1375548986,\"nBits\":\"1e0fffff\",\"nonce\":2089928209,\"merkle_root\":\"d0227b8c3e3d07bce9656b3d9e474f050d23458aaead93357dcfdac9ab9b79f9\"},\"alertpubkey\":\"045337216002ca6a71d63edf062895417610a723d453e722bf4728996c58661cdac3d4dec5cecd449b9086e9602b35cc726a9e0163e1a4d40f521fbdaebb674658\"}"

4
iguana/coins/kmd

@ -1,2 +1,4 @@
curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"komodo.conf\",\"path\":\"root/.komodo\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":0,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}"
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"komodo.conf\",\"path\":\"${HOME#"/"}/.komodo\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":0,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}"

4
iguana/coins/kmd_7776

@ -1,2 +1,4 @@
curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"komodo.conf\",\"path\":\"root/.komodo\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":0,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}"
#!/bin/bash
curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"komodo.conf\",\"path\":\"${HOME#"/"}/.komodo\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":0,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}"

2
iguana/coins/m_extract_genesis

@ -1 +1,3 @@
#!/bin/bash
gcc -o extract_genesis extract_genesis.c

2
iguana/coins/notary

@ -1 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"NOTARY\",\"services\":128,\"maxpeers\":2048,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":7775,\"rpc\":0}"

4
iguana/coins/zec

@ -1 +1,3 @@
curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"24e92764\",\"p2p\":8233,\"rpc\":8232,\"pubval\":184,\"p2shval\":189,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08\",\"protover\":170002,\"genesisblock\":\"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157\",\"debug\":0}"
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"path\":\"${HOME#"/"}/.zcash\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"24e92764\",\"p2p\":8233,\"rpc\":8232,\"pubval\":184,\"p2shval\":189,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08\",\"protover\":170002,\"genesisblock\":\"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157\",\"debug\":0}"

22
iguana/dPoW.h

@ -22,12 +22,14 @@
#define DPOW_MINSIGS 7
#define DPOW_M(bp) ((bp)->minsigs) // (((bp)->numnotaries >> 1) + 1)
#define DPOW_MODIND(bp,offset) (((((bp)->height / DPOW_CHECKPOINTFREQ) % (bp)->numnotaries) + (offset)) % (bp)->numnotaries)
#define DPOW_VERSION 0x0303
#define DPOW_VERSION 0x0404
#define DPOW_UTXOSIZE 10000
#define DPOW_MINOUTPUT 6000
#define DPOW_DURATION 300
#define DPOW_RATIFYDURATION (3600 * 24)
#define DPOW_ENTRIESCHANNEL ('e' | ('n' << 8) | ('t' << 16) | ('r' << 24))
#define DPOW_BTCENTRIESCHANNEL (~DPOW_ENTRIESCHANNEL)
#define DPOW_UTXOCHANNEL ('d' | ('P' << 8) | ('o' << 16) | ('W' << 24))
#define DPOW_SIGCHANNEL ('s' | ('i' << 8) | ('g' << 16) | ('s' << 24))
#define DPOW_SIGBTCCHANNEL (~DPOW_SIGCHANNEL)
@ -37,7 +39,7 @@
#define DPOW_FIFOSIZE 64
#define DPOW_MAXTX 8192
#define DPOW_THIRDPARTY_CONFIRMS 10
#define DPOW_THIRDPARTY_CONFIRMS 0
#define DPOW_KOMODOCONFIRMS 3
#define DPOW_BTCCONFIRMS 1
#define DPOW_MAXRELAYS 64
@ -104,14 +106,26 @@ struct dpow_block
char signedtx[32768];//,rawtx[32768];
};
struct pax_transaction
{
UT_hash_handle hh;
bits256 txid;
uint64_t komodoshis,fiatoshis;
int32_t marked,height,kmdheight;
uint16_t vout;
char symbol[16],coinaddr[64]; uint8_t rmd160[20],shortflag;
};
struct dpow_info
{
char symbol[16],dest[16]; uint8_t minerkey33[33],minerid; uint64_t lastrecvmask;
struct dpow_checkpoint checkpoint,last,destchaintip,srcfifo[DPOW_FIFOSIZE],destfifo[DPOW_FIFOSIZE];
struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE];
bits256 srctx[DPOW_MAXTX],desttx[DPOW_MAXTX];
uint32_t destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify,crcs[1024];
int32_t maxblocks;
uint32_t SRCREALTIME,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify,crcs[16];
int32_t maxblocks,SRCHEIGHT,SHORTFLAG;
struct pax_transaction *PAX;
portable_mutex_t mutex;
struct dpow_block **blocks;
};

157
iguana/dpow/dpow_fsm.c

@ -92,25 +92,31 @@ void dpow_utxosync(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow
//char str[65],str2[65];
//printf("send.(%s %s)\n",bits256_str(str,bp->notaries[i].dest.prev_hash),bits256_str(str2,bp->notaries[i].src.prev_hash));
if ( (len= dpow_rwutxobuf(1,utxodata,&U,bp)) > 0 )
dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,DPOW_UTXOCHANNEL,bp->height,utxodata,len,bp->utxocrcs);
dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,DPOW_UTXOCHANNEL,bp->height,utxodata,len);
}
}
void dpow_sync(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,uint64_t refmask,int32_t myind,bits256 srchash,uint32_t channel,int32_t src_or_dest)
void dpow_sync(struct supernet_info *myinfo,int32_t forceflag,struct dpow_info *dp,struct dpow_block *bp,int8_t bestk,uint64_t refmask,int32_t myind,bits256 srchash,uint32_t channel,int32_t src_or_dest)
{
int8_t lastk; uint64_t mask;
mask = dpow_maskmin(refmask,bp,&lastk);
if ( bestk < 0 )
mask = dpow_maskmin(refmask,bp,&lastk);
else
{
lastk = bestk;
mask = refmask;
}
//dpow_utxosync(myinfo,bp,mask,myind,srchash);
if ( bp->notaries[myind].masks[lastk] == 0 )
if ( forceflag || bp->notaries[myind].masks[lastk] == 0 )
dpow_signedtxgen(myinfo,dp,(src_or_dest != 0) ? bp->destcoin : bp->srccoin,bp,lastk,mask,myind,src_or_dest != 0 ? DPOW_SIGBTCCHANNEL : DPOW_SIGCHANNEL,src_or_dest);
}
int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint32_t channel,uint32_t height,uint8_t *data,int32_t datalen)
{
bits256 txid,commit,srchash; struct dpow_block *bp = 0; uint32_t flag = 0; int32_t src_or_dest,senderind,i,myind = -1; char str[65],str2[65]; struct dpow_sigentry dsig; struct dpow_entry *ep; struct dpow_coinentry *cp; struct dpow_utxoentry U; struct iguana_info *coin;
bits256 txid,commit,srchash,hashmsg; struct dpow_block *bp = 0; uint32_t flag = 0; int32_t src_or_dest,senderind,i,iter,rlen,myind = -1; char str[65],str2[65]; struct dpow_sigentry dsig; struct dpow_entry *ep; struct dpow_coinentry *cp; struct dpow_utxoentry U; struct iguana_info *coin;
if ( (bp= dpow_heightfind(myinfo,dp,height)) == 0 )
{
if ( (rand() % 100) == 0 && height > 0 )
if ( 0 && (rand() % 100) == 0 && height > 0 )
printf("couldnt find height.%d | if you just started notary dapp this is normal\n",height);
return(-1);
}
@ -122,7 +128,55 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3
}
for (i=0; i<32; i++)
srchash.bytes[i] = dp->minerkey33[i+1];
if ( channel == DPOW_UTXOCHANNEL )
if ( channel == DPOW_ENTRIESCHANNEL )
{
struct dpow_entry notaries[DPOW_MAXRELAYS]; uint8_t n; int8_t bestk; struct dpow_coinentry *ptr,*refptr;
rlen = 0;
bestk = data[rlen++];
n = data[rlen++];
rlen += iguana_rwbignum(0,&data[rlen],sizeof(hashmsg),hashmsg.bytes);
//printf("got ENTRIES bestk.%d (%d %llx) recv.%llx numnotaries.%d\n",bestk,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask,n);
if ( bits256_cmp(hashmsg,bp->hashmsg) == 0 )
{
memset(notaries,0,sizeof(notaries));
for (i=0; i<64; i++)
notaries[i].bestk = -1;
rlen += dpow_rwcoinentrys(0,&data[rlen],notaries,n,bestk);
//printf("matched hashmsg rlen.%d vs datalen.%d\n",rlen,datalen);
for (i=0; i<n; i++)
{
for (iter=0; iter<2; iter++)
{
ptr = iter != 0 ? &notaries[i].dest : &notaries[i].src;
refptr = iter != 0 ? &bp->notaries[i].dest : &bp->notaries[i].src;
if ( bits256_nonz(ptr->prev_hash) != 0 )
{
if ( bits256_nonz(refptr->prev_hash) == 0 )
{
printf(">>>>>>>>> %s got utxo.[%d] indirectly <<<<<<<<<<<\n",iter!=0?"dest":"src",i);
refptr->prev_hash = ptr->prev_hash;
refptr->prev_vout = ptr->prev_vout;
if ( iter == 1 && bits256_nonz(notaries[i].src.prev_hash) != 0 )
bp->recvmask |= (1LL << i);
}
}
if ( (bestk= notaries[i].bestk) >= 0 )
{
if ( ptr->siglens[bestk] > 0 && refptr->siglens[bestk] == 0 )
{
printf(">>>>>>>>>> got %s siglen.%d for [%d] indirectly bestk.%d <<<<<<<<<<\n",iter!=0?"dest":"src",ptr->siglens[bestk],i,bestk);
memcpy(refptr->sigs[bestk],ptr->sigs[bestk],ptr->siglens[bestk]);
refptr->siglens[bestk] = ptr->siglens[bestk];
if ( iter != 0 )
bp->destsigsmasks[bestk] |= (1LL << i);
else bp->srcsigsmasks[bestk] |= (1LL << i);
}
}
}
}
}
}
else if ( channel == DPOW_UTXOCHANNEL )
{
src_or_dest = 1;
coin = (src_or_dest != 0) ? bp->destcoin : bp->srccoin;
@ -132,7 +186,7 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3
printf("error from rwutxobuf\n");
return(0);
}
if ( bits256_cmp(U.hashmsg,bp->hashmsg) != 0 )
if ( bits256_cmp(U.hashmsg,bp->hashmsg) != 0 && bits256_nonz(bp->hashmsg) != 0 )
{
printf("unexpected mismatch hashmsg.%s vs %s\n",bits256_str(str,U.hashmsg),bits256_str(str2,bp->hashmsg));
return(0);
@ -145,9 +199,10 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3
dpow_utxosync(myinfo,dp,bp,0,myind,srchash);
bp->recvmask |= (1LL << senderind);
}
dpow_sync(myinfo,dp,bp,ep->recvmask,myind,srchash,channel,src_or_dest);
dpow_sync(myinfo,1,dp,bp,-1,ep->recvmask,myind,srchash,channel,src_or_dest);
flag = 1;
}
//printf("bestk.%d %llx vs recv.%llx\n",bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask);
if ( 0 && flag == 0 && bp != 0 )
printf("ep.%p sender.%d UTXO.%d hashmsg.(%s) txid.(%s) v%d %llx\n",ep,senderind,height,bits256_str(str,U.hashmsg),bits256_str(str2,src_or_dest!=0?U.desthash:U.srchash),src_or_dest!=0?U.destvout:U.srcvout,(long long)bp->recvmask);
}
@ -158,18 +213,19 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3
printf("rwsigentry error\n");
return(0);
}
//printf("got sig.%x (%d %d) <<<<<<<<<< from.%d (%d %llx) sigs.%llx\n",channel,channel == DPOW_SIGCHANNEL,channel == DPOW_SIGBTCCHANNEL,dsig.senderind,dsig.lastk,(long long)dsig.mask,(long long)(dsig.lastk>=0?bp->destsigsmasks[dsig.lastk]:0));
if ( channel == DPOW_SIGBTCCHANNEL )
{
src_or_dest = 1;
coin = bp->destcoin;
cp = &bp->notaries[dsig.senderind].dest;
//printf("gotsig %s channel.%x from %d bestk.%d %llx\n",coin->symbol,channel,dsig.senderind,dsig.lastk,(long long)dsig.mask);
}
else
{
src_or_dest = 0;
coin = bp->srccoin;
cp = &bp->notaries[dsig.senderind].src;
printf("got %s channel.%x from %d\n",coin->symbol,channel,dsig.senderind);
}
if ( dsig.senderind >= 0 && dsig.senderind < DPOW_MAXRELAYS )
{
@ -200,15 +256,15 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3
dpow_sigscheck(myinfo,dp,bp,DPOW_SIGCHANNEL,myind,0);
}
}
printf(" (%d %llx) <<<<<<<< %s from.%d got lastk.%d %llx/%llx siglen.%d >>>>>>>>>\n",bp->bestk,(long long)bp->bestmask,coin->symbol,dsig.senderind,dsig.lastk,(long long)dsig.mask,(long long)bp->destsigsmasks[dsig.lastk],dsig.siglen);
dpow_sync(myinfo,dp,bp,dsig.mask,myind,srchash,channel,src_or_dest);
//printf(" ht.%d (%d %llx) <<<<<<<< %s from.%d got lastk.%d %llx/%llx siglen.%d >>>>>>>>>\n",bp->height,bp->bestk,(long long)bp->bestmask,coin->symbol,dsig.senderind,dsig.lastk,(long long)dsig.mask,(long long)bp->destsigsmasks[dsig.lastk],dsig.siglen);
dpow_sync(myinfo,1,dp,bp,dsig.lastk,dsig.mask,myind,srchash,channel,src_or_dest);
flag = 1;
}
} else printf("%s pubkey mismatch for senderind.%d %llx vs %llx\n",coin->symbol,dsig.senderind,*(long long *)dsig.senderpub,*(long long *)bp->notaries[dsig.senderind].pubkey);
} else printf("%s illegal lastk.%d or senderind.%d or senderpub.%llx\n",coin->symbol,dsig.lastk,dsig.senderind,*(long long *)dsig.senderpub);
} else printf("couldnt find senderind.%d height.%d channel.%x\n",dsig.senderind,height,channel);
//if ( 0 && bp != 0 )
printf("%s SIG.%d sender.%d lastk.%d mask.%llx siglen.%d recv.%llx\n",coin->symbol,height,dsig.senderind,dsig.lastk,(long long)dsig.mask,dsig.siglen,(long long)bp->recvmask);
// printf("%s SIG.%d sender.%d lastk.%d mask.%llx siglen.%d recv.%llx\n",coin->symbol,height,dsig.senderind,dsig.lastk,(long long)dsig.mask,dsig.siglen,(long long)bp->recvmask);
}
else if ( channel == DPOW_TXIDCHANNEL || channel == DPOW_BTCTXIDCHANNEL )
{
@ -256,7 +312,8 @@ int32_t dpow_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo
if ( bp->state < 1000 )
{
src_or_dest = 1;
if ( (bp->bestk= dpow_bestk(bp,&bp->bestmask)) >= 0 )
bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk);
if ( bp->bestk >= 0 )
{
sendutxo = 0;
for (i=0; i<bp->numnotaries; i++)
@ -273,33 +330,54 @@ int32_t dpow_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo
}
if ( ep->masks[src_or_dest][bp->bestk] == 0 )
dpow_signedtxgen(myinfo,dp,(src_or_dest != 0) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,DPOW_SIGBTCCHANNEL,src_or_dest);
//else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel);
if ( bp->bestk >= 0 && (rand() % 10) == 0 )
dpow_sigsend(myinfo,dp,bp,myind,bp->bestk,bp->bestmask,srchash,DPOW_SIGBTCCHANNEL);
} else sendutxo = 1;
if ( sendutxo != 0 )
{
memset(&U,0,sizeof(U));
dpow_entry2utxo(&U,bp,&bp->notaries[myind]);
if ( (len= dpow_rwutxobuf(1,data,&U,bp)) > 0 )
dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,DPOW_UTXOCHANNEL,bp->height,data,len,bp->utxocrcs);
dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,DPOW_UTXOCHANNEL,bp->height,data,len);
}
if ( bp->bestk >= 0 && ep->masks[src_or_dest][bp->bestk] == 0 )
dpow_signedtxgen(myinfo,dp,(src_or_dest != 0) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,DPOW_SIGBTCCHANNEL,src_or_dest);
//else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel);
if ( bp->bestk >= 0 && (rand() % 10) == 0 )
{
dpow_sigsend(myinfo,dp,bp,myind,bp->bestk,bp->bestmask,srchash,DPOW_SIGBTCCHANNEL);
for (i=0; i<bp->numnotaries; i++)
if ( bp->notaries[i].bestk >= 0 && bp->notaries[i].bestk != bp->bestk && bitweight(bp->notaries[i].recvmask & bp->recvmask) >= 7 )
dpow_sigsend(myinfo,dp,bp,myind,bp->notaries[i].bestk,bp->recvmask,srchash,DPOW_SIGBTCCHANNEL);
}
}
else if ( bp->state != 0xffffffff )
{
src_or_dest = 0;
if ( bp->bestk >= 0 && ep->masks[src_or_dest][bp->bestk] == 0 )
dpow_signedtxgen(myinfo,dp,(src_or_dest != 0) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,DPOW_SIGCHANNEL,src_or_dest);
//else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel);
if ( bp->bestk >= 0 && (rand() % 10) == 0 )
dpow_sigsend(myinfo,dp,bp,myind,bp->bestk,bp->bestmask,srchash,DPOW_SIGCHANNEL);
}
if ( (rand() % 10) == 0 || bp->isratify != 0 )
if ( (rand() % 10) == 0 )
{
uint64_t sigsmask,srcmask;
if ( bp->bestk < 0 )
sigsmask = srcmask = 0;
else sigsmask = bp->destsigsmasks[bp->bestk], srcmask = bp->srcsigsmasks[bp->bestk];
printf("[%d] %s isratify.%d ht.%d FSM.%08x masks.%llx best.(%d %llx) sigsmask.%llx %llx src.%llx\n",myind,src_or_dest != 0 ? bp->destcoin->symbol : bp->srccoin->symbol,bp->isratify,bp->height,bp->state,(long long)bp->recvmask,bp->bestk,(long long)bp->bestmask,(long long)sigsmask,(long long)(sigsmask & bp->bestmask),(long long)srcmask);
if ( bp->isratify != 0 )
{
uint64_t sigsmask,srcmask;
if ( bp->bestk < 0 )
sigsmask = srcmask = 0;
else sigsmask = bp->destsigsmasks[bp->bestk], srcmask = bp->srcsigsmasks[bp->bestk];
printf("[%d] %s isratify.%d ht.%d FSM.%08x masks.%llx best.(%d %llx) sigsmask.%llx %llx src.%llx\n",myind,src_or_dest != 0 ? bp->destcoin->symbol : bp->srccoin->symbol,bp->isratify,bp->height,bp->state,(long long)bp->recvmask,bp->bestk,(long long)bp->bestmask,(long long)sigsmask,(long long)(sigsmask & bp->bestmask),(long long)srcmask);
}
if ( bp->isratify != 0 )
{
bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk);
dpow_sendcoinentrys(myinfo,dp,bp);
if ( bp->bestk >= 0 )
dpow_signedtxgen(myinfo,dp,(bp->state < 1000) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,bp->state < 1000 ? DPOW_SIGBTCCHANNEL : DPOW_SIGCHANNEL,bp->state < 1000);
printf("ht.%d numnotaries.%d BEST.%llx from RECV.%llx bestk.%d sigsmask.%llx missing.%llx\n",bp->height,bp->numnotaries,(long long)bp->bestmask,(long long)bp->recvmask,bp->bestk,bp->bestk>=0?(long long)bp->destsigsmasks[bp->bestk]:0,bp->bestk>=0?(long long)(bp->bestmask & ~bp->destsigsmasks[bp->bestk]):0);
if ( bp->height < DPOW_FIRSTRATIFY )
dp->blocks[bp->height] = bp;
}
}
if ( bp->state < 1000 && bp->bestk >= 0 && (bp->destsigsmasks[bp->bestk] & bp->bestmask) == bp->bestmask )
{
@ -334,7 +412,10 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info
}
bitcoin_address(coinaddr,coin->chain->pubtype,dp->minerkey33,33);
if ( bits256_nonz(bp->hashmsg) == 0 && bp->height >= DPOW_FIRSTRATIFY )
{
printf("null hashmsg\n");
return(0);
}
for (j=0; j<sizeof(srchash); j++)
srchash.bytes[j] = dp->minerkey33[j+1];
bp->bestk = dpow_bestk(bp,&bp->bestmask);
@ -450,12 +531,12 @@ void dpow_statemachinestart(void *ptr)
dp->blocks[checkpoint.blockhash.height] = bp;
bp->beacon = rand256(0);
vcalc_sha256(0,bp->commit.bytes,bp->beacon.bytes,sizeof(bp->beacon));
if ( checkpoint.blockhash.height >= DPOW_FIRSTRATIFY && dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] != 0 )
/*if ( checkpoint.blockhash.height >= DPOW_FIRSTRATIFY && dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] != 0 )
{
printf("purge %s.%d\n",dp->dest,checkpoint.blockhash.height - DPOW_FIRSTRATIFY);
free(dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY]);
dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] = 0;
}
}*/
}
bitcoin_address(srcaddr,src->chain->pubtype,dp->minerkey33,33);
bitcoin_address(destaddr,dest->chain->pubtype,dp->minerkey33,33);
@ -529,15 +610,17 @@ void dpow_statemachinestart(void *ptr)
}
sleep(1);
}
if ( (starttime= checkpoint.timestamp) == 0 )
if ( bp->isratify == 0 || (starttime= checkpoint.timestamp) == 0 )
starttime = (uint32_t)time(NULL);
printf("isratify.%d DPOW.%s statemachine checkpoint.%d %s start.%u\n",bp->isratify,src->symbol,checkpoint.blockhash.height,bits256_str(str,checkpoint.blockhash.hash),checkpoint.timestamp);
for (i=0; i<sizeof(srchash); i++)
srchash.bytes[i] = dp->minerkey33[i+1];
//printf("start utxosync start.%u %u\n",starttime,(uint32_t)time(NULL));
dpow_utxosync(myinfo,dp,bp,0,myind,srchash);
//printf("done utxosync start.%u %u\n",starttime,(uint32_t)time(NULL));
while ( time(NULL) < starttime+bp->duration && src != 0 && dest != 0 && bp->state != 0xffffffff )
{
sleep(2);
sleep(1);
if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height )
{
if ( bp->isratify == 0 )
@ -548,23 +631,33 @@ void dpow_statemachinestart(void *ptr)
else
{
bp->bestk = -1;
bp->bestmask = 0;
bp->bestmask = bp->recvmask = 0;
bp->height = ((dp->checkpoint.blockhash.height / 10) % (DPOW_FIRSTRATIFY/10)) * 10;
printf("new rotation ht.%d\n",bp->height);
dp->blocks[checkpoint.blockhash.height] = 0;
checkpoint.blockhash.height = dp->checkpoint.blockhash.height;
dp->blocks[checkpoint.blockhash.height] = bp;
/*for (i=0; i<64; i++)
{
bp->notaries[i].recvmask = 0;
bp->notaries[i].bestk = -1;
}
memset(bp->destsigsmasks,0,sizeof(bp->destsigsmasks));
memset(bp->notaries[myind].masks,0,sizeof(bp->notaries[myind].masks));*/
}
}
if ( bp->state != 0xffffffff )
{
//printf("dp->ht.%d ht.%d DEST.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,deststate,bits256_str(str,srchash.hash));
//printf("dp->ht.%d ht.%d DEST.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,bp->state,bits256_str(str,srchash));
bp->state = dpow_statemachineiterate(myinfo,dp,dest,bp,myind,1);
}
if ( dp->cancelratify != 0 && bp->isratify != 0 )
if ( 0 && dp->cancelratify != 0 && bp->isratify != 0 )
{
printf("abort pending ratify\n");
break;
}
}
printf("state machine ht.%d completed state.%x %s.%s %s.%s recvmask.%llx\n",bp->height,bp->state,dp->dest,bits256_str(str,bp->desttxid),dp->symbol,bits256_str(str2,bp->srctxid),(long long)bp->recvmask);
printf("bestk.%d %llx sigs.%llx state machine ht.%d completed state.%x %s.%s %s.%s recvmask.%llx\n",bp->bestk,(long long)bp->bestmask,(long long)(bp->bestk>=0?bp->destsigsmasks[bp->bestk]:0),bp->height,bp->state,dp->dest,bits256_str(str,bp->desttxid),dp->symbol,bits256_str(str2,bp->srctxid),(long long)bp->recvmask);
dp->lastrecvmask = bp->recvmask;
free(ptr);
}

68
iguana/dpow/dpow_network.c

@ -75,7 +75,7 @@ int32_t dpow_crc32find(struct supernet_info *myinfo,struct dpow_info *dp,uint32_
return(firstz);
}
void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen,uint32_t crcs[2])
void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen)
{
struct dpow_nanomsghdr *np; int32_t size,sentbytes = 0; uint32_t crc32;
crc32 = calc_crc32(0,data,datalen);
@ -125,7 +125,7 @@ void dpow_nanomsg_update(struct supernet_info *myinfo)
}
if ( dp != 0 && crc32 == np->crc32 && (firstz= dpow_crc32find(myinfo,dp,crc32,np->channel)) >= 0 )
{
//printf("NANORECV ht.%d channel.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d\n",np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz);
//char str[65]; printf("%s RECV ht.%d ch.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d\n",bits256_str(str,np->srchash),np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz);
if ( i == myinfo->numdpows )
printf("received nnpacket for (%s)\n",np->symbol);
else if ( dpow_datahandler(myinfo,dp,np->channel,np->height,np->packet,np->datalen) >= 0 )
@ -146,7 +146,7 @@ void dpow_nanomsg_update(struct supernet_info *myinfo)
void dpow_nanomsginit(struct supernet_info *myinfo,char *ipaddr) { }
uint32_t dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen,uint32_t crcs[2])
uint32_t dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen)
{
return(0);
}
@ -155,6 +155,56 @@ void dpow_nanomsg_update(struct supernet_info *myinfo) { }
#endif
int32_t dpow_rwcoinentry(int32_t rwflag,uint8_t *serialized,struct dpow_coinentry *src,struct dpow_coinentry *dest,int8_t *bestkp)
{
int8_t bestk; struct dpow_coinentry *ptr; int32_t siglen,iter,len = 0;
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(src->prev_hash),src->prev_hash.bytes);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(src->prev_vout),(uint32_t *)&src->prev_vout);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(dest->prev_hash),dest->prev_hash.bytes);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(dest->prev_vout),(uint32_t *)&dest->prev_vout);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(*bestkp),(uint32_t *)bestkp);
if ( (bestk= *bestkp) >= 0 )
{
for (iter=0; iter<2; iter++)
{
ptr = (iter == 0) ? src : dest;
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->siglens[bestk]),(uint32_t *)&ptr->siglens[bestk]);
if ( (siglen= ptr->siglens[bestk]) > 0 )
{
if ( rwflag != 0 )
memcpy(&serialized[len],ptr->sigs[bestk],siglen);
else memcpy(ptr->sigs[bestk],&serialized[len],siglen);
len += siglen;
}
}
}
return(len);
}
int32_t dpow_rwcoinentrys(int32_t rwflag,uint8_t *serialized,struct dpow_entry notaries[DPOW_MAXRELAYS],uint8_t numnotaries,int8_t bestk)
{
int32_t i,len = 0;
for (i=0; i<numnotaries; i++)
{
if ( rwflag != 0 )
notaries[i].bestk = bestk;
len += dpow_rwcoinentry(rwflag,&serialized[len],&notaries[i].src,&notaries[i].dest,&notaries[i].bestk);
}
return(len);
}
int32_t dpow_sendcoinentrys(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp)
{
uint8_t data[sizeof(struct dpow_coinentry)*64 + 4096]; bits256 zero; int32_t len = 0;
memset(zero.bytes,0,sizeof(zero));
//printf("ht.%d >>>>>>>>>>>>> dpow_sendcoinentrys (%d %llx) <- %llx\n",bp->height,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask);
data[len++] = bp->bestk;
data[len++] = bp->numnotaries;
len += iguana_rwbignum(1,&data[len],sizeof(bp->hashmsg),bp->hashmsg.bytes);
len += dpow_rwcoinentrys(1,&data[len],bp->notaries,bp->numnotaries,bp->bestk);
dpow_send(myinfo,dp,bp,zero,bp->hashmsg,DPOW_ENTRIESCHANNEL,bp->height,data,len);
return(len);
}
int32_t dpow_opreturnscript(uint8_t *script,uint8_t *opret,int32_t opretlen)
{
@ -301,8 +351,16 @@ int32_t dpow_rwsigentry(int32_t rwflag,uint8_t *data,struct dpow_sigentry *dsig)
void dpow_sigsend(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,int32_t myind,int8_t bestk,uint64_t bestmask,bits256 srchash,uint32_t sigchannel)
{
struct dpow_sigentry dsig; int32_t i,len; uint8_t data[4096]; struct dpow_entry *ep;
if ( ((1LL << myind) & bestmask) == 0 )
return;
ep = &bp->notaries[myind];
printf("sigsend.%s: myind.%d bestk.%d %llx >>>>>> broadcast channel.%x\n",sigchannel == DPOW_SIGCHANNEL ? bp->srccoin->symbol : bp->destcoin->symbol,myind,bestk,(long long)bestmask,sigchannel);
if ( bestk >= 0 )
{
if ( sigchannel == DPOW_SIGCHANNEL )
bp->srcsigsmasks[bestk] |= (1LL << myind);
else bp->destsigsmasks[bestk] |= (1LL << myind);
}
//printf("ht.%d sigsend.%s: myind.%d bestk.%d %llx >>>>>> best.(%d %llx) recv.%llx sigs.%llx\n",bp->height,sigchannel == DPOW_SIGCHANNEL ? bp->srccoin->symbol : bp->destcoin->symbol,myind,bestk,(long long)bestmask,bestk,(long long)(bestk>=0?bestmask:0),(long long)bp->recvmask,(long long)(bestk>=0?bp->destsigsmasks[bestk]:0));
memset(&dsig,0,sizeof(dsig));
for (i=0; i<33; i++)
dsig.senderpub[i] = dp->minerkey33[i];
@ -322,7 +380,7 @@ void dpow_sigsend(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_
}
memcpy(dsig.senderpub,dp->minerkey33,33);
len = dpow_rwsigentry(1,data,&dsig);
dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,sigchannel,bp->height,data,len,bp->sigcrcs);
dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,sigchannel,bp->height,data,len);
}
uint32_t komodo_assetmagic(char *symbol,uint64_t supply)

18
iguana/dpow/dpow_prices.c

@ -1913,11 +1913,15 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i
void PAX_init()
{
double commission = 0.;
init_Currencymasks();
//calc_smooth_code(127,7);
tradebot_monitorall(0,0,0,0,"fxcm",commission);
tradebot_monitorall(0,0,0,0,"truefx",commission);
//tradebot_monitorall(0,0,0,0,"instaforex",commission);
exchange_create("PAX",0);
static int32_t didinit; //double commission = 0.;
if ( didinit == 0 )
{
init_Currencymasks();
//calc_smooth_code(127,7);
//tradebot_monitorall(0,0,0,0,"fxcm",commission);
//tradebot_monitorall(0,0,0,0,"truefx",commission);
//tradebot_monitorall(0,0,0,0,"instaforex",commission);
exchange_create("PAX",0);
didinit = 1;
}
}

479
iguana/dpow/dpow_rpc.c

@ -13,6 +13,8 @@
* *
******************************************************************************/
#define issue_curl(cmdstr) bitcoind_RPC(0,"curl",cmdstr,0,0,0)
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t kmdheight)
{
int32_t i,num=-1; struct iguana_info *coin; char params[256],*retstr,*pubkeystr; cJSON *retjson,*item,*array;
@ -53,14 +55,14 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t kmdheight)
bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *coin)
{
char *retstr; bits256 blockhash;
if ( 0 && strcmp(coin->symbol,"USD") == 0 )
printf("dpow_getbestblockhash %s FULLNODE.%d\n",coin->symbol,coin->FULLNODE);
memset(blockhash.bytes,0,sizeof(blockhash));
if ( coin->FULLNODE < 0 )
{
if ( coin->lastbesthashtime+20 > time(NULL) && bits256_nonz(coin->lastbesthash) != 0 )
return(coin->lastbesthash);
if ( (retstr= bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"getbestblockhash","")) != 0 )
{
if ( 0 && strcmp(coin->symbol,"USD") == 0 )
if ( strcmp(coin->symbol,"USD") == 0 )
printf("%s getbestblockhash.(%s)\n",coin->symbol,retstr);
if ( is_hexstr(retstr,0) == sizeof(blockhash)*2 )
decode_hex(blockhash.bytes,sizeof(blockhash),retstr);
@ -74,6 +76,11 @@ bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *c
else
{
}
if ( bits256_nonz(blockhash) != 0 )
{
coin->lastbesthash = blockhash;
coin->lastbesthashtime = (uint32_t)time(NULL);
}
return(blockhash);
}
@ -263,22 +270,24 @@ char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *c
int32_t dpow_getchaintip(struct supernet_info *myinfo,bits256 *blockhashp,uint32_t *blocktimep,bits256 *txs,uint32_t *numtxp,struct iguana_info *coin)
{
int32_t n,i,height = -1,maxtx = *numtxp; bits256 besthash; cJSON *array,*json;
int32_t n,i,height = -1,maxtx = *numtxp; bits256 besthash,oldhash; cJSON *array,*json;
*numtxp = *blocktimep = 0;
oldhash = coin->lastbesthash;
*blockhashp = besthash = dpow_getbestblockhash(myinfo,coin);
if ( bits256_nonz(besthash) != 0 )
if ( bits256_nonz(besthash) != 0 && bits256_cmp(oldhash,besthash) != 0 )
{
if ( (json= dpow_getblock(myinfo,coin,besthash)) != 0 )
{
if ( (height= juint(json,"height")) != 0 && (*blocktimep= juint(json,"time")) != 0 )
{
coin->lastbestheight = height;
if ( height > coin->longestchain )
coin->longestchain = height;
if ( (array= jarray(&n,json,"tx")) != 0 )
{
for (i=0; i<n&&i<maxtx; i++)
txs[i] = jbits256i(array,i);
if ( 0 && strcmp(coin->symbol,"USD") == 0 )
//if ( 0 && strcmp(coin->symbol,"USD") == 0 )
printf("dpow_getchaintip %s ht.%d time.%u numtx.%d\n",coin->symbol,height,*blocktimep,n);
*numtxp = n;
}
@ -286,7 +295,7 @@ int32_t dpow_getchaintip(struct supernet_info *myinfo,bits256 *blockhashp,uint32
free_json(json);
}
}
return(height);
return(coin->lastbestheight);
}
int32_t dpow_vini_ismine(struct supernet_info *myinfo,struct dpow_info *dp,cJSON *item)
@ -354,3 +363,459 @@ int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits
printf("%s haveutxo.%d\n",coin->symbol,haveutxo);
return(haveutxo);
}
char *dpow_issuemethod(char *userpass,char *method,char *params,uint16_t port)
{
char url[512],*retstr=0,*retstr2=0,postdata[8192];
if ( params == 0 || params[0] == 0 )
params = (char *)"[]";
if ( strlen(params) < sizeof(postdata)-128 )
{
sprintf(url,(char *)"http://127.0.0.1:%u",port);
sprintf(postdata,"{\"method\":\"%s\",\"params\":%s}",method,params);
//printf("postdata.(%s) USERPASS.(%s)\n",postdata,KMDUSERPASS);
retstr2 = bitcoind_RPC(&retstr,(char *)"debug",url,userpass,method,params);
}
return(retstr2);
}
uint64_t dpow_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume)
{
char params[512],*retstr; uint64_t satoshis = 0; cJSON *retjson,*result; struct iguana_info *kmdcoin;
kmdcoin = iguana_coinfind("KMD");
*seedp = 0;
sprintf(params,"[\"%s\", \"%s\", \"%d\", \"%.8f\"]",base,rel,height,(double)basevolume/SATOSHIDEN);
if ( kmdcoin != 0 && (retstr= dpow_issuemethod(kmdcoin->chain->userpass,"paxprice",params,kmdcoin->chain->rpcport)) != 0 )
{
if ( (retjson= cJSON_Parse(retstr)) != 0 )
{
if ( (result= jobj(retjson,"result")) != 0 )
{
satoshis = jdouble(result,"relvolume") * SATOSHIDEN;
*seedp = j64bits(result,"seed");
}
free_json(retjson);
}
printf("dpow_paxprice.(%s) -> %s %.8f\n",params,retstr,dstr(satoshis));
}
return(satoshis);
}
#define KOMODO_PUBTYPE 60
int32_t PAX_pubkey(int32_t rwflag,uint8_t *pubkey33,uint8_t *addrtypep,uint8_t rmd160[20],char fiat[4],uint8_t *shortflagp,int64_t *fiatoshisp)
{
if ( rwflag != 0 )
{
memset(pubkey33,0,33);
pubkey33[0] = 0x02 | (*shortflagp != 0);
memcpy(&pubkey33[1],fiat,3);
iguana_rwnum(rwflag,&pubkey33[4],sizeof(*fiatoshisp),(void *)fiatoshisp);
pubkey33[12] = *addrtypep;
memcpy(&pubkey33[13],rmd160,20);
}
else
{
*shortflagp = (pubkey33[0] == 0x03);
memcpy(fiat,&pubkey33[1],3);
fiat[3] = 0;
iguana_rwnum(rwflag,&pubkey33[4],sizeof(*fiatoshisp),(void *)fiatoshisp);
if ( *shortflagp != 0 )
*fiatoshisp = -(*fiatoshisp);
*addrtypep = pubkey33[12];
memcpy(rmd160,&pubkey33[13],20);
}
return(33);
}
uint64_t PAX_fiatdest(uint64_t *seedp,int32_t tokomodo,char *destaddr,uint8_t pubkey33[33],char *coinaddr,int32_t kmdheight,char *origbase,int64_t fiatoshis)
{
uint8_t shortflag=0; char base[4]; int32_t i; uint8_t addrtype,rmd160[20]; int64_t komodoshis=0;
for (i=0; i<3; i++)
base[i] = toupper(origbase[i]);
base[i] = 0;
if ( strcmp(base,"KMD") == 0 )
return(0);
if ( fiatoshis < 0 )
shortflag = 1, fiatoshis = -fiatoshis;
komodoshis = dpow_paxprice(seedp,kmdheight,base,(char *)"KMD",(uint64_t)fiatoshis);
if ( bitcoin_addr2rmd160(&addrtype,rmd160,coinaddr) == 20 )
{
PAX_pubkey(1,pubkey33,&addrtype,rmd160,base,&shortflag,tokomodo != 0 ? &komodoshis : &fiatoshis);
bitcoin_address(destaddr,KOMODO_PUBTYPE,pubkey33,33);
}
return(komodoshis);
}
int32_t dpow_scriptitemlen(int32_t *opretlenp,uint8_t *script)
{
int32_t opretlen,len = 0;
if ( (opretlen= script[len++]) >= 0x4c )
{
if ( opretlen == 0x4c )
opretlen = script[len++];
else if ( opretlen == 0x4d )
{
opretlen = script[len++];
opretlen = (opretlen << 8) | script[len++];
}
}
*opretlenp = opretlen;
return(len);
}
cJSON *dpow_paxjson(struct pax_transaction *pax)
{
uint8_t addrtype,rmd160[20]; int32_t i; char rmdstr[41]; cJSON *item = cJSON_CreateObject();
if ( pax != 0 )
{
jaddbits256(item,"prev_hash",pax->txid);
jaddnum(item,"prev_vout",pax->vout);
if ( pax->shortflag != 0 )
jaddnum(item,"short",pax->shortflag);
jaddnum(item,pax->symbol,dstr(pax->fiatoshis));
jaddstr(item,"fiat",pax->symbol);
jaddnum(item,"kmdheight",pax->kmdheight);
jaddnum(item,"height",pax->height);
jaddnum(item,"KMD",dstr(pax->komodoshis));
jaddstr(item,"address",pax->coinaddr);
bitcoin_addr2rmd160(&addrtype,rmd160,pax->coinaddr);
for (i=0; i<20; i++)
sprintf(&rmdstr[i<<1],"%02x",rmd160[i]);
rmdstr[40] = 0;
jaddstr(item,"rmd160",rmdstr);
}
return(item);
}
uint64_t dpow_paxtotal(struct dpow_info *dp)
{
struct pax_transaction *pax,*tmp; uint64_t total = 0;
pthread_mutex_lock(&dp->mutex);
/*if ( dp->PAX != 0 )
{
tmp = 0;
pax= dp->PAX->hh.next;
while ( pax != 0 && pax != tmp )
{
if ( pax->marked == 0 )
total += pax->komodoshis;
tmp = pax;
pax = pax->hh.next;
}
}*/
HASH_ITER(hh,dp->PAX,pax,tmp)
{
if ( pax->marked == 0 )
total += pax->komodoshis;
}
pthread_mutex_unlock(&dp->mutex);
return(total);
}
struct pax_transaction *dpow_paxfind(struct dpow_info *dp,struct pax_transaction *space,bits256 txid,uint16_t vout)
{
struct pax_transaction *pax;
pthread_mutex_lock(&dp->mutex);
HASH_FIND(hh,dp->PAX,&txid,sizeof(txid),pax);
if ( pax != 0 )
memcpy(space,pax,sizeof(*pax));
pthread_mutex_unlock(&dp->mutex);
return(pax);
}
struct pax_transaction *dpow_paxmark(struct dpow_info *dp,struct pax_transaction *space,bits256 txid,uint16_t vout,int32_t mark)
{
struct pax_transaction *pax;
pthread_mutex_lock(&dp->mutex);
HASH_FIND(hh,dp->PAX,&txid,sizeof(txid),pax);
if ( pax == 0 )
{
pax = (struct pax_transaction *)calloc(1,sizeof(*pax));
pax->txid = txid;
pax->vout = vout;
HASH_ADD_KEYPTR(hh,dp->PAX,&pax->txid,sizeof(pax->txid),pax);
}
if ( pax != 0 )
{
pax->marked = mark;
int32_t i; for (i=0; i<32; i++)
printf("%02x",((uint8_t *)&txid)[i]);
printf(" paxmark.ht %d vout%d\n",mark,vout);
memcpy(space,pax,sizeof(*pax));
}
pthread_mutex_unlock(&dp->mutex);
return(pax);
}
cJSON *dpow_withdraws_pending(struct dpow_info *dp)
{
struct pax_transaction *pax,*tmp; cJSON *retjson = cJSON_CreateArray();
pthread_mutex_lock(&dp->mutex);
/*if ( dp->PAX != 0 )
{
tmp = 0;
pax = dp->PAX->hh.next;
while ( pax != 0 && pax != tmp )
{
if ( pax->marked == 0 )
jaddi(retjson,dpow_paxjson(pax));
tmp = pax;
pax = pax->hh.next;
}
}*/
HASH_ITER(hh,dp->PAX,pax,tmp)
{
if ( pax->marked == 0 )
jaddi(retjson,dpow_paxjson(pax));
}
pthread_mutex_unlock(&dp->mutex);
return(retjson);
}
void dpow_issuer_withdraw(struct dpow_info *dp,char *coinaddr,uint64_t fiatoshis,int32_t shortflag,char *symbol,uint64_t komodoshis,uint8_t *rmd160,bits256 txid,uint16_t vout,int32_t kmdheight,int32_t height) // assetchain context
{
struct pax_transaction *pax;
pthread_mutex_lock(&dp->mutex);
HASH_FIND(hh,dp->PAX,&txid,sizeof(txid),pax);
if ( pax == 0 )
{
pax = (struct pax_transaction *)calloc(1,sizeof(*pax));
pax->txid = txid;
pax->vout = vout;
HASH_ADD_KEYPTR(hh,dp->PAX,&pax->txid,sizeof(pax->txid),pax);
}
pthread_mutex_unlock(&dp->mutex);
if ( coinaddr != 0 )
{
strcpy(pax->coinaddr,coinaddr);
pax->komodoshis = komodoshis;
pax->shortflag = shortflag;
strcpy(pax->symbol,symbol);
pax->fiatoshis = fiatoshis;
memcpy(pax->rmd160,rmd160,20);
pax->kmdheight = kmdheight;
pax->height = height;
if ( pax->marked == 0 )
printf("ADD WITHDRAW %s %.8f -> %s %.8f TO PAX kht.%d ht.%d\n",symbol,dstr(pax->fiatoshis),coinaddr,dstr(pax->komodoshis),kmdheight,height);
else printf("MARKED WITHDRAW %s %.8f -> %s %.8f TO PAX kht.%d ht.%d\n",symbol,dstr(pax->fiatoshis),coinaddr,dstr(pax->komodoshis),kmdheight,height);
}
else
{
pax->marked = height;
printf("MARK WITHDRAW ht.%d\n",height);
}
}
void dpow_issuer_voutupdate(struct dpow_info *dp,char *symbol,int32_t isspecial,int32_t height,int32_t txi,bits256 txid,int32_t vout,int32_t numvouts,int64_t fiatoshis,uint8_t *script,int32_t len)
{
char base[16],destaddr[64],coinaddr[64]; uint8_t addrtype,shortflag,rmd160[20],pubkey33[33]; int64_t checktoshis,komodoshis; uint64_t seed; struct pax_transaction space; int32_t i,kmdheight,opretlen,offset = 0;
if ( script[offset++] == 0x6a )
{
memset(base,0,sizeof(base));
offset += dpow_scriptitemlen(&opretlen,&script[offset]);
if ( script[offset] == 'W' && strcmp(dp->symbol,"KMD") != 0 )
{
// if valid add to pricefeed for issue
printf("WITHDRAW ht.%d txi.%d vout.%d %.8f opretlen.%d\n",height,txi,vout,dstr(fiatoshis),opretlen);
if ( opretlen == 38 ) // any KMD tx
{
offset++;
offset += PAX_pubkey(0,&script[offset],&addrtype,rmd160,base,&shortflag,&komodoshis);
iguana_rwnum(0,&script[offset],sizeof(kmdheight),&kmdheight);
if ( komodoshis < 0 )
komodoshis = -komodoshis;
bitcoin_address(coinaddr,addrtype,rmd160,20);
checktoshis = PAX_fiatdest(&seed,1,destaddr,pubkey33,coinaddr,kmdheight,base,fiatoshis);
for (i=0; i<32; i++)
printf("%02x",((uint8_t *)&txid)[i]);
printf(" <- txid.v%u ",vout);
for (i=0; i<33; i++)
printf("%02x",pubkey33[i]);
printf(" checkpubkey fiat %.8f check %.8f vs komodoshis %.8f dest.(%s) kmdheight.%d ht.%d seed.%llu\n",dstr(fiatoshis),dstr(checktoshis),dstr(komodoshis),destaddr,kmdheight,height,(long long)seed);
if ( shortflag == dp->SHORTFLAG )
{
if ( shortflag == 0 )
{
if ( seed == 0 || checktoshis >= komodoshis )
{
if ( dpow_paxfind(dp,&space,txid,vout) == 0 )
dpow_issuer_withdraw(dp,coinaddr,fiatoshis,shortflag,base,komodoshis,rmd160,txid,vout,kmdheight,height);
}
}
else // short
{
for (i=0; i<opretlen; i++)
printf("%02x",script[i]);
printf(" opret[%c] fiatoshis %.8f vs check %.8f\n",script[0],dstr(fiatoshis),dstr(checktoshis));
if ( seed == 0 || fiatoshis < checktoshis )
{
}
}
}
}
}
else if ( script[offset] == 'X' && strcmp(dp->symbol,"KMD") == 0 )
{
printf("WITHDRAW issued ht.%d txi.%d vout.%d %.8f\n",height,txi,vout,dstr(fiatoshis));
if ( opretlen == 46 ) // any KMD tx
{
offset++;
offset += PAX_pubkey(0,&script[offset],&addrtype,rmd160,base,&shortflag,&fiatoshis);
iguana_rwnum(0,&script[offset],sizeof(kmdheight),&kmdheight);
iguana_rwnum(0,&script[offset],sizeof(height),&height);
if ( fiatoshis < 0 )
fiatoshis = -fiatoshis;
bitcoin_address(coinaddr,addrtype,rmd160,20);
checktoshis = PAX_fiatdest(&seed,1,destaddr,pubkey33,coinaddr,kmdheight,base,fiatoshis);
for (i=0; i<32; i++)
printf("%02x",((uint8_t *)&txid)[i]);
printf(" <- txid.v%u ",vout);
for (i=0; i<33; i++)
printf("%02x",pubkey33[i]);
printf(" checkpubkey check %.8f v %.8f dest.(%s) height.%d\n",dstr(checktoshis),dstr(fiatoshis),destaddr,height);
if ( shortflag == 0 )
{
if ( seed == 0 || checktoshis > fiatoshis )
{
dpow_paxmark(dp,&space,txid,vout,height);
}
}
else
{
}
}
}
}
}
int32_t dpow_issuer_tx(struct dpow_info *dp,struct iguana_info *coin,int32_t height,int32_t txi,char *txidstr,uint32_t port)
{
char *retstr,params[256],*hexstr; uint8_t script[10000]; cJSON *json,*oldpub,*newpub,*result,*vouts,*item,*sobj; int32_t vout,n,len,isspecial,retval = -1; uint64_t value; bits256 txid;
sprintf(params,"[\"%s\", 1]",txidstr);
if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getrawtransaction",params,port)) != 0 )
{
if ( (json= cJSON_Parse(retstr)) != 0 )
{
//printf("TX.(%s)\n",retstr);
if ( (result= jobj(json,(char *)"result")) != 0 )
{
oldpub = jobj(result,(char *)"vpub_old");
newpub = jobj(result,(char *)"vpub_new");
retval = 0;
if ( oldpub == 0 && newpub == 0 && (vouts= jarray(&n,result,(char *)"vout")) != 0 )
{
isspecial = 0;
txid = jbits256(result,(char *)"txid");
for (vout=0; vout<n; vout++)
{
item = jitem(vouts,vout);
value = SATOSHIDEN * jdouble(item,(char *)"value");
if ( (sobj= jobj(item,(char *)"scriptPubKey")) != 0 )
{
if ( (hexstr= jstr(sobj,(char *)"hex")) != 0 )
{
len = (int32_t)strlen(hexstr) >> 1;
if ( vout == 0 && ((memcmp(&hexstr[2],CRYPTO777_PUBSECPSTR,66) == 0 && len == 35) || (memcmp(&hexstr[6],CRYPTO777_RMD160STR,40) == 0 && len == 25)) )
isspecial = 1;
else if ( len <= sizeof(script) )
{
decode_hex(script,len,hexstr);
dpow_issuer_voutupdate(dp,coin->symbol,isspecial,height,txi,txid,vout,n,value,script,len);
}
}
}
}
}
} else printf("error getting txids.(%s)\n",retstr);
free_json(json);
}
free(retstr);
}
return(retval);
}
int32_t dpow_issuer_block(struct dpow_info *dp,struct iguana_info *coin,int32_t height,uint16_t port)
{
char *retstr,*retstr2,params[128],*txidstr; int32_t i,n,retval = -1; cJSON *json,*tx=0,*result=0,*result2;
sprintf(params,"[%d]",height);
if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getblockhash",params,port)) != 0 )
{
if ( (result= cJSON_Parse(retstr)) != 0 )
{
if ( (txidstr= jstr(result,(char *)"result")) != 0 && strlen(txidstr) == 64 )
{
sprintf(params,"[\"%s\"]",txidstr);
if ( (retstr2= dpow_issuemethod(coin->chain->userpass,(char *)"getblock",params,port)) != 0 )
{
//printf("getblock.(%s)\n",retstr2);
if ( (json= cJSON_Parse(retstr2)) != 0 )
{
if ( (result2= jobj(json,(char *)"result")) != 0 && (tx= jarray(&n,result2,(char *)"tx")) != 0 )
{
for (i=0; i<n; i++)
if ( dpow_issuer_tx(dp,coin,height,i,jstri(tx,i),port) < 0 )
break;
if ( i == n )
retval = 0;
else printf("dpow_issuer_block ht.%d error i.%d vs n.%d\n",height,i,n);
} else printf("cant get result.%p or tx.%p\n",result,tx);
free_json(json);
} else printf("cant parse2.(%s)\n",retstr2);
free(retstr2);
} else printf("error getblock %s\n",params);
} else printf("strlen.%ld (%s)\n",strlen(txidstr),txidstr);
free_json(result);
} else printf("couldnt parse.(%s)\n",retstr);
free(retstr);
} else printf("error from getblockhash %d\n",height);
return(retval);
}
int32_t dpow_issuer_iteration(struct dpow_info *dp,struct iguana_info *coin,int32_t height,uint32_t *isrealtimep)
{
char *retstr; int32_t i,kmdheight; cJSON *infoobj,*result; uint16_t port = coin->chain->rpcport;
if ( height <= 0 )
height = 1;
*isrealtimep = 0;
if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getinfo",0,port)) != 0 )
{
if ( (infoobj= cJSON_Parse(retstr)) != 0 )
{
if ( (result= jobj(infoobj,(char *)"result")) != 0 && (kmdheight= jint(result,(char *)"blocks")) != 0 )
{
for (i=0; i<1000 && height<=kmdheight; i++,height++)
{
/*fprintf(stderr,"%s.%d ",coin->symbol,height);
if ( (height % 10) == 0 )
{
if ( (height % 100) == 0 )
fprintf(stderr,"%s.%d ",coin->symbol,height);
memset(&zero,0,sizeof(zero));
komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,0,0,0,0);
}*/
if ( dpow_issuer_block(dp,coin,height,port) < 0 )
{
printf("error height %d\n",height);
break;
}
usleep(10000);
}
if ( height >= kmdheight )
*isrealtimep = (uint32_t)time(NULL);
}
free_json(infoobj);
}
//printf("GETINFO.(%s)\n",retstr);
free(retstr);
}
else
{
printf("error from %s\n",coin->symbol);
sleep(3);
}
return(height);
}

64
iguana/dpow/dpow_tx.c

@ -47,26 +47,43 @@ int32_t dpow_bestk(struct dpow_block *bp,uint64_t *maskp)
uint64_t dpow_maskmin(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp)
{
int32_t j,m,k; uint64_t mask = 0;
int32_t j,m,k; uint64_t bestmask,mask;
bestmask = mask = 0;
for (j=m=0; j<bp->numnotaries; j++)
{
k = DPOW_MODIND(bp,j);//((bp->height % bp->numnotaries) + j) % bp->numnotaries;
k = DPOW_MODIND(bp,j);
if ( bits256_nonz(bp->notaries[k].src.prev_hash) != 0 && bits256_nonz(bp->notaries[k].dest.prev_hash) != 0 )
{
mask |= (1LL << k);
if ( ++m >= DPOW_M(bp) )
if ( ++m == DPOW_M(bp) )
{
*lastkp = k;
break;
bestmask = mask;
}
}
}
return(mask);
bp->recvmask |= mask;
if ( *lastkp >= 0 )
{
for (mask=j=0; j<bp->numnotaries; j++)
{
if ( bp->notaries[j].src.siglens[*lastkp] > 0 )
mask |= (1LL << j);
}
bp->srcsigsmasks[*lastkp] |= mask;
for (mask=j=0; j<bp->numnotaries; j++)
{
if ( bp->notaries[j].dest.siglens[*lastkp] > 0 )
mask |= (1LL << j);
}
bp->destsigsmasks[*lastkp] |= mask;
}
return(bestmask);
}
struct dpow_block *dpow_heightfind(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height)
{
int32_t incr = 100000;
int32_t r,h,incr = 100000; struct dpow_block *bp = 0;
if ( height > dp->maxblocks )
{
dp->blocks = realloc(dp->blocks,sizeof(*dp->blocks) * (dp->maxblocks + incr));
@ -74,8 +91,18 @@ struct dpow_block *dpow_heightfind(struct supernet_info *myinfo,struct dpow_info
dp->maxblocks += incr;
}
if ( height < dp->maxblocks )
return(dp->blocks!=0?dp->blocks[height]:0);
else return(0);
bp = dp->blocks!=0 ? dp->blocks[height] : 0;
if ( bp == 0 && height < DPOW_FIRSTRATIFY )
{
r = (rand() % DPOW_FIRSTRATIFY);
for (h=0; h<DPOW_FIRSTRATIFY; h++)
{
height = (r + h) % DPOW_FIRSTRATIFY;
if ( (bp= dp->blocks[height]) != 0 )
return(bp);
}
}
return(bp);
}
int32_t dpow_voutratify(struct dpow_block *bp,uint8_t *serialized,int32_t m,uint8_t pubkeys[][33],int32_t numratified)
@ -151,7 +178,7 @@ bits256 dpow_notarytx(char *signedtx,int32_t *numsigsp,int32_t isPoS,struct dpow
len += iguana_rwvarint32(1,&serialized[len],(uint32_t *)&m);
for (j=m=0; j<bp->numnotaries; j++)
{
k = DPOW_MODIND(bp,j);//((bp->height % bp->numnotaries) + j) % bp->numnotaries;
k = DPOW_MODIND(bp,j);
if ( ((1LL << k) & bestmask) != 0 )
{
ep = &bp->notaries[k];
@ -202,7 +229,7 @@ cJSON *dpow_vins(struct iguana_info *coin,struct dpow_block *bp,int8_t bestk,uin
vins = cJSON_CreateArray();
for (j=0; j<bp->numnotaries; j++)
{
k = DPOW_MODIND(bp,j);//((bp->height % bp->numnotaries) + j) % bp->numnotaries;
k = DPOW_MODIND(bp,j);
if ( ((1LL << k) & bestmask) != 0 )
{
ep = &bp->notaries[k];
@ -256,7 +283,7 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu
item = jitem(vin,j);
if ( (sobj= jobj(item,"scriptSig")) != 0 && (sigstr= jstr(sobj,"hex")) != 0 && strlen(sigstr) > 32 )
{
printf("%s height.%d mod.%d VINI.%d myind.%d MINE.(%s) j.%d\n",(src_or_dest != 0) ? bp->destcoin->symbol : bp->srccoin->symbol,bp->height,DPOW_MODIND(bp,0),j,myind,jprint(item,0),j);
//printf("bestk.%d %llx %s height.%d mod.%d VINI.%d myind.%d MINE.(%s) j.%d\n",bestk,(long long)bestmask,(src_or_dest != 0) ? bp->destcoin->symbol : bp->srccoin->symbol,bp->height,DPOW_MODIND(bp,0),j,myind,jprint(item,0),j);
cp->siglens[bestk] = (int32_t)strlen(sigstr) >> 1;
if ( src_or_dest != 0 )
bp->destsigsmasks[bestk] |= (1LL << myind);
@ -282,11 +309,8 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu
int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struct iguana_info *coin,struct dpow_block *bp,int8_t bestk,uint64_t bestmask,int32_t myind,uint32_t sigchannel,int32_t src_or_dest)
{
int32_t j,incr,numsigs,retval=-1; char rawtx[32768]; cJSON *vins; bits256 txid,srchash,zero; struct dpow_entry *ep;
if ( bp->numnotaries < 8 )
incr = 1;
else incr = sqrt(bp->numnotaries) + 1;
bestmask = dpow_maskmin(bestmask,bp,&bestk);
int32_t j,numsigs,retval=-1; char rawtx[32768]; cJSON *vins; bits256 txid,srchash,zero; struct dpow_entry *ep;
//bestmask = dpow_maskmin(bestmask,bp,&bestk);
ep = &bp->notaries[myind];
memset(&zero,0,sizeof(zero));
if ( bestk < 0 )
@ -305,11 +329,13 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc
decode_hex(txdata+32,len,rawtx);
for (j=0; j<sizeof(srchash); j++)
txdata[j] = tmp.bytes[j];
dpow_send(myinfo,bp,zero,bp->hashmsg,(bits256_nonz(bp->btctxid) == 0) ? DPOW_BTCTXIDCHANNEL : DPOW_TXIDCHANNEL,bp->height,txdata,len+32,bp->txidcrcs);*/
dpow_send(myinfo,bp,zero,bp->hashmsg,(bits256_nonz(bp->btctxid) == 0) ? DPOW_BTCTXIDCHANNEL : DPOW_TXIDCHANNEL,bp->height,txdata,len+32);*/
dpow_rawtxsign(myinfo,dp,coin,bp,rawtx,vins,bestk,bestmask,myind,src_or_dest);
} else printf("signedtxgen zero txid or null rawtx\n");
free_json(vins);
} else printf("signedtxgen error generating vins\n");
}
else if ( (bestmask & bp->recvmask) != bestmask )
printf("signedtxgen error generating vins bestk.%d %llx recv.%llx need to recv %llx\n",bestk,(long long)bestmask,(long long)bp->recvmask,(long long)(bestmask & ~bp->recvmask));
return(retval);
}
@ -344,7 +370,7 @@ void dpow_sigscheck(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo
decode_hex(txdata+32,len,bp->signedtx);
for (j=0; j<sizeof(srchash); j++)
txdata[j] = txid.bytes[j];
dpow_send(myinfo,dp,bp,txid,bp->hashmsg,(src_or_dest != 0) ? DPOW_BTCTXIDCHANNEL : DPOW_TXIDCHANNEL,bp->height,txdata,len+32,bp->txidcrcs);
dpow_send(myinfo,dp,bp,txid,bp->hashmsg,(src_or_dest != 0) ? DPOW_BTCTXIDCHANNEL : DPOW_TXIDCHANNEL,bp->height,txdata,len+32);
printf("complete statemachine.%s ht.%d\n",coin->symbol,bp->height);
bp->state = src_or_dest != 0 ? 1000 : 0xffffffff;
} else printf("sendtxid mismatch got %s instead of %s\n",bits256_str(str,txid),bits256_str(str2,signedtxid));

2
iguana/exchanges/okcoin.c

@ -44,7 +44,7 @@ double UPDATE(struct exchange_info *exchange,char *base,char *rel,struct exchang
{
fprintf(stderr,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FATAL ERROR OKCOIN.(%s) only supports USD\n",url);
printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FATAL ERROR OKCOIN.(%s) only supports USD\n",url);
exit(-1);
//exit(-1);
return(0);
}
return(exchanges777_standardprices(exchange,commission,base,rel,url,quotes,0,0,maxdepth,0,invert));

70
iguana/iguana777.c

@ -266,7 +266,7 @@ void iguana_emitQ(struct iguana_info *coin,struct iguana_bundle *bp)
ptr->type = 'E';
ptr->starttime = (uint32_t)time(NULL);
//printf("%s EMIT.%d[%d] emitfinish.%u\n",coin->symbol,ptr->hdrsi,bp->n,bp->emitfinish);
queue_enqueue("emitQ",&emitQ,&ptr->DL,0);
queue_enqueue("emitQ",&emitQ,&ptr->DL);
}
void iguana_bundleQ(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,int32_t timelimit)
@ -293,7 +293,7 @@ void iguana_bundleQ(struct supernet_info *myinfo,struct iguana_info *coin,struct
ptr->timelimit = timelimit;
coin->numbundlesQ++;
// printf("%s.%d %p bundle.%d[%d] ht.%d emitfinish.%u\n",coin->symbol,n,bp,ptr->hdrsi,bp->n,bp->bundleheight,bp->emitfinish);
queue_enqueue("bundlesQ",&bundlesQ,&ptr->DL,0);
queue_enqueue("bundlesQ",&bundlesQ,&ptr->DL);
}
else
{
@ -386,7 +386,7 @@ int32_t iguana_validated(struct iguana_info *coin)
int32_t iguana_helperA(struct supernet_info *myinfo,struct iguana_info *coin,int32_t helperid,struct iguana_bundle *bp,int32_t convertflag)
{
int32_t retval,num = 0;
int32_t retval,numXspends,num = 0;
if ( bp == 0 )
{
printf("iguana_helperA unexpected null bp\n");
@ -400,7 +400,8 @@ int32_t iguana_helperA(struct supernet_info *myinfo,struct iguana_info *coin,int
{
if ( retval > 0 )
{
printf("GENERATED UTXO.%d for ht.%d duration %d seconds\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo);
numXspends = iguana_Xspendmap(coin,&bp->ramchain,bp);
printf("GENERATED UTXO.%d for ht.%d duration %d seconds numXspends.%d\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo,numXspends);
num++;
}
bp->utxofinish = (uint32_t)time(NULL);
@ -435,9 +436,11 @@ int32_t iguana_helperB(struct iguana_info *coin,int32_t helperid,struct iguana_b
return(0);
}
int32_t iguana_utxogen(struct supernet_info *myinfo,struct iguana_info *coin,int32_t helperid,int32_t convertflag);
void iguana_update_balances(struct supernet_info *myinfo,struct iguana_info *coin)
{
int32_t i,hdrsi,max; struct iguana_bundle *bp; char fname[1024];
int32_t i,hdrsi,max,retval,numXspends,convertflag = 1; struct iguana_bundle *bp; char fname[1024];
if ( coin->RTheight > 0 )
{
printf("Need to restart iguana to generate new balances files\n");
@ -447,7 +450,27 @@ void iguana_update_balances(struct supernet_info *myinfo,struct iguana_info *coi
max = coin->bundlescount;
if ( coin->bundles[max-1] == coin->current || coin->bundles[max-1] == 0 || (coin->bundles[max-1] != 0 && coin->bundles[max-1]->utxofinish <= 1) )
max--;
//coin->spendvectorsaved = 0;
if ( coin->chain->zcash != 0 )
{
coin->spendvectorsaved = 0;
for (i=0; i<coin->bundlescount-1; i++)
{
if ( (bp= coin->bundles[i]) == 0 )
continue;
if ( (retval= iguana_spendvectors(myinfo,coin,bp,&bp->ramchain,0,bp->n,convertflag,0)) >= 0 ) //bp->utxofinish > 1 ||
{
if ( retval > 0 )
{
numXspends = iguana_Xspendmap(coin,&bp->ramchain,bp);
printf("GENERATED UTXO.%d for ht.%d duration %d seconds numX.%d\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo,numXspends);
}
bp->utxofinish = (uint32_t)time(NULL);
}
}
}
coin->spendvectorsaved = (uint32_t)time(NULL);
//if ( coin->chain->zcash != 0 )
// iguana_utxogen(myinfo,coin,0,1);
if ( iguana_balancefinished(coin) < max && iguana_spendvectorsaves(coin) == 0 ) //
{
if ( coin->origbalanceswritten <= 1 )
@ -462,6 +485,7 @@ void iguana_update_balances(struct supernet_info *myinfo,struct iguana_info *coi
sprintf(fname,"%s/%s/accounts/lastspends.%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight);
OS_removefile(fname,0);
iguana_volatilesalloc(coin,&bp->ramchain,0);//i < hdrsi);
//iguana_Xspendmap(coin,&bp->ramchain,bp);
}
printf("accounts files purged\n");
sleep(3);
@ -511,11 +535,14 @@ int32_t iguana_utxogen(struct supernet_info *myinfo,struct iguana_info *coin,int
max = coin->bundlescount;
if ( coin->bundles[max-1] == coin->current || coin->bundles[max-1] == 0 || (coin->bundles[max-1] != 0 && coin->bundles[max-1]->utxofinish <= 1) )
max--;
printf("helperid.%d start %s utxogen bundlescount.%d max.%d\n",helperid,coin->symbol,coin->bundlescount,max);
//printf("helperid.%d start %s utxogen bundlescount.%d max.%d\n",helperid,coin->symbol,coin->bundlescount,max);
if ( helperid < incr )
{
for (hdrsi=helperid; hdrsi<max; hdrsi+=incr)
{
coin->bundles[hdrsi]->utxofinish = 1;
num += iguana_helperA(myinfo,coin,helperid,coin->bundles[hdrsi],convertflag);
}
}
while ( (n= iguana_utxofinished(coin)) < max )
{
@ -708,7 +735,7 @@ void iguana_helper(void *arg)
{
if ( coin->firstRTheight == 0 )
{
if ( coin->spendvectorsaved == 1 )
if ( coin->spendvectorsaved == 1 )//&& coin->chain->zcash == 0 )
iguana_utxogen(myinfo,coin,helperid,1);
else if ( coin->spendvectorsaved > 1 && (coin->spendvalidated & (1 << helperid)) == 0 )
{
@ -737,18 +764,22 @@ void iguana_helper(void *arg)
if ( i == j )
{
iguana_bundlevalidate(myinfo,coin,bp,0);
if ( bp->validated > 1 )
if ( bp->validated > 1 )//&& coin->chain->zcash == 0 )
{
for (i=0; i<j; i++)
if ( coin->bundles[i] == 0 || coin->bundles[i]->utxofinish <= 1 )
break;
retval = 1;
if ( bp->utxofinish == 0 || (retval= iguana_spendvectors(myinfo,coin,bp,&bp->ramchain,0,bp->n,1,0)) >= 0 )
if ( bp->utxofinish == 0 )
{
if ( retval > 0 )
bp->startutxo = (uint32_t)time(NULL);
if ( (retval= iguana_spendvectors(myinfo,coin,bp,&bp->ramchain,0,bp->n,1,0)) >= 0 )
{
printf("GENERATED UTXO.%d for ht.%d duration %d seconds\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo);
bp->utxofinish = (uint32_t)time(NULL);
if ( retval > 0 )
{
printf(" GENERATED UTXO.%d for ht.%d duration %d seconds\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo);
bp->utxofinish = (uint32_t)time(NULL);
}
}
}
}
@ -766,7 +797,7 @@ void iguana_helper(void *arg)
n = queue_size(&bundlesQ);
for (iter=0; iter<n; iter++)
{
if ( (ptr= queue_dequeue(&bundlesQ,0)) != 0 )
if ( (ptr= queue_dequeue(&bundlesQ)) != 0 )
{
idle = 0;
coin = ptr->coin;
@ -808,7 +839,7 @@ void iguana_helper(void *arg)
void iguana_callcoinstart(struct supernet_info *myinfo,struct iguana_info *coin)
{
struct iguana_bundle *bp; int32_t bundlei; bits256 zero; char dirname[512],*symbol;
struct iguana_bundle *bp; struct iguana_peer *addr; int32_t bundlei; bits256 zero; char dirname[512],*symbol;
iguana_rwiAddrind(coin,0,0,0);
//for (i=0; i<sizeof(*coin->chain); i++)
// printf("%02x",((uint8_t *)coin->chain)[i]);
@ -838,6 +869,10 @@ void iguana_callcoinstart(struct supernet_info *myinfo,struct iguana_info *coin)
memset(zero.bytes,0,sizeof(zero));
if ( (bp= iguana_bundlecreate(coin,&bundlei,0,*(bits256 *)coin->chain->genesis_hashdata,zero,1)) != 0 )
bp->bundleheight = 0;
addr = &coin->peers->active[IGUANA_MAXPEERS-2];
iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(coin->seedipaddr));
printf("SEED_IPADDR initpeer.(%s)\n",addr->ipaddr);
iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD);
}
void iguana_coinloop(void *arg)
@ -1030,6 +1065,7 @@ void iguana_nameset(char name[64],char *symbol,cJSON *json)
struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers,int64_t maxrecvcache,uint64_t services,int32_t initialheight,int32_t maphash,int32_t minconfirms,int32_t maxrequests,int32_t maxbundles,cJSON *json,int32_t virtcoin)
{
struct iguana_chain *iguana_createchain(cJSON *json);
struct supernet_info *myinfo = SuperNET_MYINFO(0);
struct iguana_info *coin; int32_t j,m,mult,maxval,mapflags; char name[64]; cJSON *peers;
mapflags = IGUANA_MAPRECVDATA | maphash*IGUANA_MAPTXIDITEMS | maphash*IGUANA_MAPPKITEMS | maphash*IGUANA_MAPBLOCKITEMS | maphash*IGUANA_MAPPEERITEMS;
iguana_nameset(name,symbol,json);
@ -1053,6 +1089,8 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers,
else coin->PREFETCHLAG = -1;
if ( (coin->MAXSTUCKTIME= juint(json,"maxstuck")) == 0 )
coin->MAXSTUCKTIME = _IGUANA_MAXSTUCKTIME;
if ( myinfo != 0 && myinfo->seedipaddr[0] != 0 )
safecopy(coin->seedipaddr,myinfo->seedipaddr,sizeof(coin->seedipaddr));
if ( (coin->startPEND= juint(json,"startpend")) == 0 )
{
if ( strcmp("BTCD",coin->symbol) == 0 )
@ -1090,7 +1128,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers,
if ( coin->MAXMEM == 0 )
coin->MAXMEM = IGUANA_DEFAULTRAM;
coin->MAXMEM *= (1024L * 1024 * 1024);
coin->enableCACHE = (strcmp("BTCD",coin->symbol) == 0);
coin->enableCACHE = 0;//(strcmp("BTC",coin->symbol) != 0);
if ( jobj(json,"cache") != 0 )
coin->enableCACHE = juint(json,"cache");
if ( (coin->polltimeout= juint(json,"poll")) <= 0 )

1
iguana/iguana777.h

@ -103,6 +103,7 @@ struct supernet_info
void *PAXDATA;
struct liquidity_info linfos[64];
struct komodo_notaries NOTARY;
char seedipaddr[64];
// compatibility
bits256 pangea_category,instantdex_category;
uint8_t logs[256],exps[510];

10
iguana/iguana_accept.c

@ -134,7 +134,7 @@ void iguana_acceptloop(void *args)
ptr->sock = sock;
ptr->port = cli_addr.sin_port;
printf("queue PENDING ACCEPTS\n");
queue_enqueue("acceptQ",&coin->acceptQ,&ptr->DL,0);
queue_enqueue("acceptQ",&coin->acceptQ,&ptr->DL);
}
else
{
@ -152,7 +152,7 @@ void iguana_acceptloop(void *args)
int32_t iguana_pendingaccept(struct iguana_info *coin)
{
struct iguana_accept *ptr; char ipaddr[64]; struct iguana_peer *addr;
if ( (ptr= queue_dequeue(&coin->acceptQ,0)) != 0 )
if ( (ptr= queue_dequeue(&coin->acceptQ)) != 0 )
{
if ( (addr= iguana_peerslot(coin,ptr->ipbits,0)) != 0 )
{
@ -163,7 +163,7 @@ int32_t iguana_pendingaccept(struct iguana_info *coin)
iguana_launch(coin,"accept",iguana_dedicatedglue,addr,IGUANA_CONNTHREAD);
myfree(ptr,sizeof(*ptr));
return(1);
} else queue_enqueue("requeue_acceptQ",&coin->acceptQ,&ptr->DL,0);
} else queue_enqueue("requeue_acceptQ",&coin->acceptQ,&ptr->DL);
}
return(0);
}
@ -185,13 +185,13 @@ void iguana_msgrequestQ(struct iguana_info *coin,struct iguana_peer *addr,int32_
msg->addr = addr;
msg->hash2 = hash2;
msg->type = type;
queue_enqueue("msgrequest",&coin->msgrequestQ,&msg->DL,0);
queue_enqueue("msgrequest",&coin->msgrequestQ,&msg->DL);
}
int32_t iguana_process_msgrequestQ(struct supernet_info *myinfo,struct iguana_info *coin)
{
struct iguana_peermsgrequest *msg; int32_t height,len,flag = 0; bits256 checktxid; struct iguana_txid *tx,T; struct iguana_peer *addr;
if ( (msg= queue_dequeue(&coin->msgrequestQ,0)) != 0 )
if ( (msg= queue_dequeue(&coin->msgrequestQ)) != 0 )
{
flag = 1;
if ( msg->addr != 0 )

22
iguana/iguana_blocks.c

@ -203,14 +203,8 @@ void _iguana_blocklink(struct iguana_info *coin,struct iguana_block *prev,struct
struct iguana_block *iguana_blockhashset(char *debugstr,struct iguana_info *coin,int32_t height,bits256 hash2,int32_t createflag)
{
struct iguana_block *block,*prev; int32_t size;
/*while ( coin->blockdepth > 0 )
{
usleep(100000);
if ( coin->blockdepth > 0 )
printf("A %s >>>>>>>>>> OK only if rare %s blockhashset.%d depth.%d\n",coin->symbol,debugstr,height,coin->blockdepth);
//fprintf(stderr,">>>>>>>>>> OK only if rare %s blockhashset.%d depth.%d\n",debugstr,height,depth);
//printf("%d\n",1/(1 - depth/depth));
}*/
#ifndef __APPLE__
#endif
portable_mutex_lock(&coin->blocks_mutex);
coin->blockdepth++;
HASH_FIND(hh,coin->blocks.hash,&hash2,sizeof(hash2),block);
@ -218,20 +212,11 @@ struct iguana_block *iguana_blockhashset(char *debugstr,struct iguana_info *coin
{
if ( coin->blockdepth > 0 )
coin->blockdepth--;
/*while ( coin->blockdepth > 0 )
{
usleep(100000);
if ( coin->blockdepth > 0 )
printf("B %s >>>>>>>>>> OK only if rare %s match blockhashset.%d depth.%d\n",coin->symbol,debugstr,height,coin->blockdepth);
//fprintf(stderr,">>>>>>>>>> OK only if rare%s match blockhashset.%d depth.%d\n",debugstr,height,depth);
//printf("%d\n",1/(1 - depth/depth));
}*/
portable_mutex_unlock(&coin->blocks_mutex);
return(block);
}
if ( createflag > 0 )
{
//portable_mutex_lock(&coin->blocks_mutex);
size = (int32_t)((coin->chain->zcash != 0) ? sizeof(struct iguana_zblock) : sizeof(struct iguana_block));
block = calloc(1,size);
block->RO.hash2 = hash2;
@ -257,7 +242,6 @@ struct iguana_block *iguana_blockhashset(char *debugstr,struct iguana_info *coin
if ( tmp != block )
printf("%s height.%d search error %p != %p\n",str,height,block,tmp);
}
//portable_mutex_unlock(&coin->blocks_mutex);
}
if ( coin->blockdepth > 0 )
coin->blockdepth--;
@ -353,7 +337,7 @@ void iguana_blockzcopy(uint8_t zcash,struct iguana_block *dest,struct iguana_blo
int32_t iguana_blockvalidate(struct supernet_info *myinfo,struct iguana_info *coin,int32_t *validp,struct iguana_block *block,int32_t dispflag)
{
bits256 hash2; uint8_t serialized[sizeof(struct iguana_msgblock) + 4096];
if ( coin->chain->debug != 0 )
if ( coin->chain->debug != 0 || coin->chain->zcash != 0 )
{
*validp = 1;
return(0);

26
iguana/iguana_bundles.c

@ -685,7 +685,7 @@ int32_t iguana_bundleissuemissing(struct supernet_info *myinfo,struct iguana_inf
req->bp = bp;
req->height = bp->bundleheight + i;
req->bundlei = i;
queue_enqueue("missing",&coin->priorityQ,&req->DL,0);
queue_enqueue("missing",&coin->priorityQ,&req->DL);
bp->issued[i] = 1;
n++;
if ( 0 && bp == coin->current )
@ -749,7 +749,7 @@ int32_t iguana_blast(struct iguana_info *coin,struct iguana_peer *addr)
req->bp = bp;
req->height = bp->bundleheight + i;
req->bundlei = i;
queue_enqueue("blast",&coin->priorityQ,&req->DL,0);
queue_enqueue("blast",&coin->priorityQ,&req->DL);
}
}
if ( n > m )
@ -881,7 +881,7 @@ int32_t iguana_bundlehdr(struct supernet_info *myinfo,struct iguana_info *coin,s
if ( time(NULL) > bp->hdrtime+dist && (bp == coin->current || bp->hdrsi >= coin->bundlescount-2 || (strcmp("BTC",coin->symbol) != 0 && bp->numhashes < bp->n && (bp->speculative == 0 || bp->hdrsi >= coin->longestchain/bp->n))) )
{
bp->hdrtime = (uint32_t)time(NULL);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])));
}
if ( time(NULL) > bp->hdrtime+dist && strcmp("BTC",coin->symbol) != 0 && (bp == coin->current || bp->hdrsi == coin->bundlescount-1) && bits256_nonz(bp->nextbundlehash2) == 0 )
{
@ -892,7 +892,7 @@ int32_t iguana_bundlehdr(struct supernet_info *myinfo,struct iguana_info *coin,s
if ( GETBIT(bp->haveblock,i) == 0 )
bp->issued[i] = 0;
bp->hdrtime = (uint32_t)time(NULL);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])));
}
iguana_bundleissuemissing(myinfo,coin,bp,3,3.);
/*if ( bp == coin->current )
@ -1035,16 +1035,16 @@ int64_t iguana_bundlecalcs(struct supernet_info *myinfo,struct iguana_info *coin
int32_t iguana_bundlefinalize(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,struct OS_memspace *mem,struct OS_memspace *memB)
{
int32_t i; struct iguana_bundle *tmpbp; struct iguana_blockreq *breq;
int32_t i; struct iguana_bundle *tmpbp; //struct iguana_blockreq *breq;
if ( coin->firstRTheight == 0 && iguana_bundleready(myinfo,coin,bp,0) == bp->n )
{
printf(">>>>>>>>>>>>>> EMIT.[%3d] %s | 1st.%-3d h.%-3d c.%-3d s.[%3d] maxB.%d NET.(h%d b%d) %u:%02u\n",bp->hdrsi,coin->symbol,coin->current!=0?coin->current->hdrsi:-1,coin->current!=0?coin->current->numhashes:-1,coin->current!=0?coin->current->numcached:-1,coin->current!=0?coin->current->numsaved:-1,coin->MAXBUNDLES,HDRnet,queue_size(&coin->priorityQ),(uint32_t)(time(NULL)-coin->startutc)/60,(uint32_t)(time(NULL)-coin->startutc)%60);
if ( queue_size(&coin->priorityQ) > 10000 )
/*if ( queue_size(&coin->priorityQ) > 10000 )
{
while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 )
while ( (breq= queue_dequeue(&coin->priorityQ)) != 0 )
myfree(breq,sizeof(*breq));
//printf("cleared priorityQ\n");
}
}*/
if ( bp->emitfinish != 0 )
{
printf("already EMIT for bundle.%d\n",bp->hdrsi);
@ -1486,9 +1486,9 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch
coin->stuckiters = (int32_t)(lag/coin->MAXSTUCKTIME);
if ( coin->stuckiters > 2 )
{
while ( (breq= queue_dequeue(&coin->blocksQ,0)) != 0 )
while ( (breq= queue_dequeue(&coin->blocksQ)) != 0 )
myfree(breq,sizeof(*breq));
while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 )
while ( (breq= queue_dequeue(&coin->priorityQ)) != 0 )
myfree(breq,sizeof(*breq));
for (i=0; i<bp->n; i++)
{
@ -1560,11 +1560,11 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch
iguana_setmaxbundles(coin);
strcpy(coin->statusstr,str);
coin->estsize = estsize;
if ( queue_size(&coin->priorityQ) > 10000 )
/*if ( queue_size(&coin->priorityQ) > 10000 )
{
while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 )
while ( (breq= queue_dequeue(&coin->priorityQ)) != 0 )
myfree(breq,sizeof(*breq));
//printf("cleared priorityQ\n");
}
}*/
}

13
iguana/iguana_chains.c

@ -321,7 +321,12 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c
if ( juint(argjson,"p2p") != 0 )
chain->portp2p = juint(argjson,"p2p");
else chain->portp2p = juint(argjson,"portp2p");
if ( (chain->rpcport= juint(argjson,"rpc")) == 0 && strcmp(chain->symbol,"RELAY") != 0 )
if ( jstr(argjson,"rpchost") != 0 )
safecopy(chain->serverport,jstr(argjson,"rpchost"),sizeof(chain->serverport));
if ( jstr(argjson,"userpass") != 0 )
safecopy(chain->userpass,jstr(argjson,"userpass"),sizeof(chain->userpass));
chain->rpcport = juint(argjson,"rpcport");
if ( chain->rpcport == 0 && (chain->rpcport= juint(argjson,"rpc")) == 0 && strcmp(chain->symbol,"RELAY") != 0 )
{
if ( chain->portp2p != 0 )
chain->rpcport = chain->portp2p-1;
@ -340,6 +345,8 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c
else if ( strcmp("BTCD",chain->symbol) == 0 )
chain->rpcport = 14632;
}
if ( chain->serverport[0] == 0 && (port= extract_userpass(chain->serverport,chain->userpass,chain->symbol,chain->userhome,path,conf)) != 0 )
chain->rpcport = port;
chain->zcash = juint(argjson,"zcash");
chain->debug = juint(argjson,"debug");
chain->fixit = juint(argjson,"fixit");
@ -359,8 +366,6 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c
chain->targetspacing = NTARGETSPACING;
if ( (chain->targettimespan= jint(argjson,"targettimespan")) == 0 )
chain->targettimespan = NTARGETSPACING * 60;
if ( (port= extract_userpass(chain->serverport,chain->userpass,chain->symbol,chain->userhome,path,conf)) != 0 )
chain->rpcport = port;
if ( jobj(argjson,"halving") != 0 )
chain->halvingduration = juint(argjson,"halving");
else chain->halvingduration = 210000;
@ -500,7 +505,7 @@ void iguana_chaininit(struct supernet_info *myinfo,struct iguana_chain *chain,in
chain->bundlesize = _IGUANA_BLOCKHASHES;
}
if ( chain->zcash != 0 )
chain->bundlesize = 1000;
chain->bundlesize = 160;
if ( strcmp(chain->symbol,"BTC") == 0 )
chain->bundlesize = 100;
decode_hex((uint8_t *)chain->genesis_hashdata,32,(char *)chain->genesis_hash);

22
iguana/iguana_exchanges.c

@ -754,7 +754,7 @@ void exchanges777_loop(void *ptr)
PAX_idle(myinfo);
flag = retval = 0;
retstr = 0;
if ( (req= queue_dequeue(&exchange->requestQ,0)) != 0 )
if ( (req= queue_dequeue(&exchange->requestQ)) != 0 )
{
//printf("dequeued %s.%c\n",exchange->name,req->func);
if ( req->dead == 0 )
@ -782,7 +782,7 @@ void exchanges777_loop(void *ptr)
// queue_enqueue("Xpending",&exchange->pendingQ,&req->DL,0), flag++;
//else
if ( retval == EXCHANGE777_REQUEUE )
queue_enqueue("requeue",&exchange->requestQ,&req->DL,0);
queue_enqueue("requeue",&exchange->requestQ,&req->DL);
else
{
printf("exchanges777_process: illegal retval.%d\n",retval);
@ -805,7 +805,7 @@ void exchanges777_loop(void *ptr)
iguana_statemachineupdate(myinfo,exchange);
//printf("InstantDEX call update\n");
}*/
if ( (req= queue_dequeue(&exchange->pricesQ,0)) != 0 )
if ( (req= queue_dequeue(&exchange->pricesQ)) != 0 )
{
//printf("check %s pricesQ (%s %s)\n",exchange->name,req->base,req->rel);
if ( req->dead == 0 )
@ -824,7 +824,7 @@ void exchanges777_loop(void *ptr)
//printf("%-10s %s/%s numbids.%d numasks.%d\n",exchange->name,req->base,req->rel,req->numbids,req->numasks);
prices777_processprice(exchange,req->base,req->rel,req->bidasks,req->depth);
}
queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL,0);
queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL);
}
else
{
@ -843,12 +843,12 @@ struct exchange_request *exchanges777_baserelfind(struct exchange_info *exchange
{
struct exchange_request PAD,*req,*retreq=0;
memset(&PAD,0,sizeof(PAD));
queue_enqueue("pricesQ",&exchange->pricesQ,&PAD.DL,0);
while ( (req= queue_dequeue(&exchange->pricesQ,0)) != 0 && req != &PAD )
queue_enqueue("pricesQ",&exchange->pricesQ,&PAD.DL);
while ( (req= queue_dequeue(&exchange->pricesQ)) != 0 && req != &PAD )
{
if ( ((req->invert == 0 && strcmp(base,req->base) == 0 && strcmp(rel,req->rel) == 0) || (req->invert != 0 && strcmp(rel,req->base) == 0 && strcmp(base,req->rel) == 0)) && (func < 0 || req->func == func) )
retreq = req;
queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL,0);
queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL);
}
return(retreq);
}
@ -875,7 +875,7 @@ char *exchanges777_submit(struct exchange_info *exchange,struct exchange_request
maxseconds = EXCHANGES777_DEFAULT_TIMEOUT;
retstrp = req->retstrp;
//printf("submit to %p\n",&exchange->requestQ);
queue_enqueue("exchangeQ",&exchange->requestQ,&req->DL,0);
queue_enqueue("exchangeQ",&exchange->requestQ,&req->DL);
for (i=0; i<maxseconds; i++)
{
if ( retstrp != 0 && (retstr= *retstrp) != 0 )
@ -947,7 +947,7 @@ char *exchanges777_Qprices(struct exchange_info *exchange,char *base,char *rel,i
{
req->func = 'M';
//printf("Monitor.%s (%s %s) invert.%d\n",exchange->name,base,rel,req->invert);
queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL,0);
queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL);
return(clonestr("{\"result\":\"start monitoring\"}"));
}
}
@ -1009,7 +1009,7 @@ void iguana_gotquotesM(struct iguana_info *coin,struct iguana_peer *addr,bits256
//printf("got %d quotes from %s\n",n,addr->ipaddr);
req = iguana_bundlereq(coin,addr,'Q',0,0);
req->hashes = quotes, req->n = n;
queue_enqueue("recvQ",&exchange->recvQ,&req->DL,0);
queue_enqueue("recvQ",&exchange->recvQ,&req->DL);
}
struct exchange_info *exchange_create(char *exchangestr,cJSON *argjson)
@ -1124,7 +1124,7 @@ void exchanges777_init(struct supernet_info *myinfo,cJSON *exchanges,int32_t sle
{
if ( strcmp(Exchange_funcs[i]->name,"PAX") == 0 || strcmp(Exchange_funcs[i]->name,"truefx") == 0 || strcmp(Exchange_funcs[i]->name,"fxcm") == 0 || strcmp(Exchange_funcs[i]->name,"instaforex") == 0 )
{
exchange->pollgap = 10;
exchange->pollgap = 60;
continue;
}
if ( ((exchange= exchanges777_find(Exchange_funcs[i]->name)) == 0 && (exchange= exchange_create(Exchange_funcs[i]->name,0)) != 0) || (exchange= exchanges777_info(Exchange_funcs[i]->name,sleepflag,argjson,0)) != 0 )

34
iguana/iguana_init.c

@ -17,12 +17,14 @@
void iguana_initQ(queue_t *Q,char *name)
{
char *tst,*str = "need to init each Q when single threaded";
struct stritem *tst,*item;
memset(Q,0,sizeof(*Q));
item = calloc(1,sizeof(*item)+100);
strcpy(item->str,"hello, world");
strcpy(Q->name,name);
queue_enqueue(name,Q,queueitem(str),1);
if ( (tst= queue_dequeue(Q,1)) != 0 )
free_queueitem(tst);
queue_enqueue(name,Q,&item->DL);
if ( (tst= queue_dequeue(Q)) != 0 )
free(tst);
}
void iguana_initQs(struct iguana_info *coin)
@ -151,7 +153,7 @@ bits256 iguana_genesis(struct supernet_info *myinfo,struct iguana_info *coin,str
int32_t iguana_savehdrs(struct iguana_info *coin)
{
char fname[512],shastr[65],tmpfname[512],tmpfname2[512],str2[65],str[65],oldfname[512];
bits256 sha256all; FILE *fp,*fp2; struct iguana_bundle *bp; int32_t hdrsi,n,retval = 0;
bits256 sha256all; FILE *fp=0,*fp2=0; struct iguana_bundle *bp; int32_t hdrsi,n,retval = 0;
n = coin->blocks.hwmchain.height + 1;
sprintf(tmpfname,"%s/%s/hdrs.txt",GLOBAL_TMPDIR,coin->symbol), OS_compatible_path(tmpfname);
sprintf(tmpfname2,"%s/%s/hdrs.h",GLOBAL_TMPDIR,coin->symbol), OS_compatible_path(tmpfname);
@ -303,11 +305,11 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3
{
if ( m < coin->MAXPEERS/2 )
{
if ( 0 && m == 0 )
if ( 0 && m == 0 && coin->seedipaddr[0] != 0 )
{
addr = &coin->peers->active[m++];
iguana_initpeer(coin,addr,(uint32_t)calc_ipbits("127.0.0.1"));
//printf("call initpeer.(%s)\n",addr->ipaddr);
iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(coin->seedipaddr));
printf("SEED_IPADDR initpeer.(%s)\n",addr->ipaddr);
iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD);
}
#ifndef IGUANA_DISABLEPEERS
@ -470,7 +472,7 @@ void iguana_blockspurge(struct iguana_info *coin)
void iguana_coinpurge(struct iguana_info *coin)
{
int32_t i,saved; struct iguana_bundle *bp; char *hashstr; struct iguana_bundlereq *req; struct iguana_blockreq *breq; struct iguana_helper *ptr;
int32_t i,saved; struct iguana_bundle *bp; struct iguana_bundlereq *req; struct iguana_blockreq *breq; struct iguana_helper *ptr; struct stritem *hashitem;
saved = coin->active, coin->active = 0;
coin->started = 0;
while ( coin->idletime == 0 && coin->emitbusy > 0 )
@ -479,19 +481,19 @@ void iguana_coinpurge(struct iguana_info *coin)
sleep(1);
}
coin->RTgenesis = 0;
while ( (ptr= queue_dequeue(&bundlesQ,0)) != 0 )
while ( (ptr= queue_dequeue(&bundlesQ)) != 0 )
myfree(ptr,ptr->allocsize);
if ( 1 )
{
while ( (hashstr= queue_dequeue(&coin->hdrsQ,1)) != 0 )
free_queueitem(hashstr);
while ( (breq= queue_dequeue(&coin->blocksQ,0)) != 0 )
while ( (hashitem= queue_dequeue(&coin->hdrsQ)) != 0 )
free(hashitem);
while ( (breq= queue_dequeue(&coin->blocksQ)) != 0 )
myfree(breq,sizeof(*breq));
while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 )
while ( (breq= queue_dequeue(&coin->priorityQ)) != 0 )
myfree(breq,sizeof(*breq));
while ( (req= queue_dequeue(&coin->cacheQ,0)) != 0 )
while ( (req= queue_dequeue(&coin->cacheQ)) != 0 )
myfree(req,req->allocsize);
while ( (req= queue_dequeue(&coin->recvQ,0)) != 0 )
while ( (req= queue_dequeue(&coin->recvQ)) != 0 )
{
if ( req->blocks != 0 )
myfree(req->blocks,sizeof(*req->blocks) * req->n), req->blocks = 0;

6
iguana/iguana_json.c

@ -594,12 +594,14 @@ ZERO_ARGS(bitcoinrpc,getdifficulty)
STRING_ARG(iguana,addcoin,newcoin)
{
char *symbol; int32_t retval;
char *symbol,*seedip; int32_t retval;
if ( (symbol= newcoin) == 0 && coin != 0 )
symbol = coin->symbol;
if ( symbol != 0 )
{
printf(">> addcoin.%s\n",symbol);
if ( (seedip= jstr(json,"seedipaddr")) != 0 )
safecopy(myinfo->seedipaddr,seedip,sizeof(myinfo->seedipaddr));
printf(">> addcoin.%s seedipaddr.%s\n",symbol,myinfo->seedipaddr);
#ifdef __PNACL__
// if ( strcmp(symbol,"BTC") == 0 )
// return(clonestr("{\"result\":\"BTC for chrome app is not yet\"}"));

39
iguana/iguana_msg.c

@ -101,7 +101,7 @@ int32_t iguana_rwzsolution(int32_t rwflag,uint8_t *serialized,uint8_t *solution,
int32_t iguana_rwblockhdr(int32_t rwflag,uint8_t zcash,uint8_t *serialized,struct iguana_msgzblock *zmsg)
{
uint32_t tmp; struct iguana_msgblock *msg = (void *)zmsg; int32_t len = 0;
struct iguana_msgzblockhdr zH; uint32_t tmp; struct iguana_msgblock *msg = (void *)zmsg; int32_t len = 0;
if ( zcash == 0 )
{
len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->H.version),&msg->H.version);
@ -113,29 +113,33 @@ int32_t iguana_rwblockhdr(int32_t rwflag,uint8_t zcash,uint8_t *serialized,struc
}
else
{
len += iguana_rwnum(rwflag,&serialized[len],sizeof(zmsg->zH.version),&zmsg->zH.version);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zmsg->zH.prev_block),zmsg->zH.prev_block.bytes);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zmsg->zH.merkle_root),zmsg->zH.merkle_root.bytes);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zmsg->zH.reserved),zmsg->zH.reserved.bytes);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(zmsg->zH.timestamp),&zmsg->zH.timestamp);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(zmsg->zH.bits),&zmsg->zH.bits);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zmsg->zH.bignonce),zmsg->zH.bignonce.bytes);
if ( rwflag != 0 )
zH = zmsg->zH;
len += iguana_rwnum(rwflag,&serialized[len],sizeof(zH.version),&zH.version);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zH.prev_block),zH.prev_block.bytes);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zH.merkle_root),zH.merkle_root.bytes);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zH.reserved),zH.reserved.bytes);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(zH.timestamp),&zH.timestamp);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(zH.bits),&zH.bits);
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zH.bignonce),zH.bignonce.bytes);
//char str[65]; printf("prev.(%s) len.%d [%d %d %d]\n",bits256_str(str,msg->H.prev_block),len,serialized[len],serialized[len+1],serialized[len+2]);
if ( rwflag != 0 )
memcpy(&serialized[len],zmsg->zH.var_numelements,sizeof(zmsg->zH.var_numelements));
else memcpy(zmsg->zH.var_numelements,&serialized[len],sizeof(zmsg->zH.var_numelements));
memcpy(&serialized[len],zH.var_numelements,sizeof(zH.var_numelements));
else memcpy(zH.var_numelements,&serialized[len],sizeof(zH.var_numelements));
//printf("numelements: (%02x %02x %02x)\n",serialized[len],serialized[len+1],serialized[len+2]);
len += sizeof(zmsg->zH.var_numelements);
if ( iguana_rwvarint32(0,zmsg->zH.var_numelements,(uint32_t *)&tmp) != sizeof(zmsg->zH.var_numelements) )
printf("rw.%d unexpected varint size for zmsg.zH.numelements <- %d %d %d\n",rwflag,zmsg->zH.var_numelements[0],zmsg->zH.var_numelements[1],zmsg->zH.var_numelements[2]);
len += sizeof(zH.var_numelements);
if ( iguana_rwvarint32(0,zH.var_numelements,(uint32_t *)&tmp) != sizeof(zH.var_numelements) )
printf("rw.%d unexpected varint size for zmsg.zH.numelements <- %d %d %d\n",rwflag,zH.var_numelements[0],zH.var_numelements[1],zH.var_numelements[2]);
if ( tmp != ZCASH_SOLUTION_ELEMENTS )
{
int32_t i; for (i=0; i<157; i++)
printf("%02x",serialized[i]);
printf(" rw.%d unexpected ZCASH_SOLUTION_ELEMENTS, (%02x %02x %02x) expected %d tmp.%d len.%d\n",rwflag,zmsg->zH.var_numelements[0],zmsg->zH.var_numelements[1],zmsg->zH.var_numelements[2],ZCASH_SOLUTION_ELEMENTS,tmp,len);
printf(" rw.%d unexpected ZCASH_SOLUTION_ELEMENTS, (%02x %02x %02x) expected %d tmp.%d len.%d\n",rwflag,zH.var_numelements[0],zH.var_numelements[1],zH.var_numelements[2],ZCASH_SOLUTION_ELEMENTS,tmp,len);
return(-1);
}
len += iguana_rwzsolution(rwflag,&serialized[len],zmsg->zH.solution,tmp);
len += iguana_rwzsolution(rwflag,&serialized[len],zH.solution,tmp);
if ( rwflag == 0 )
zmsg->zH = zH;
}
return(len);
}
@ -972,7 +976,7 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s
if ( (n= iguana_gentxarray(myinfo,coin,rawmem,&txdata,&len,data,recvlen)) == recvlen || n == recvlen-1 )
{
len = n;
iguana_gotblockM(myinfo,coin,addr,&txdata,rawmem->ptr,H,data,recvlen,fromcache);
iguana_gotblockM(myinfo,coin,addr,&txdata,rawmem->ptr,H,data,recvlen,fromcache,0*coin->chain->zcash);
}
else
{
@ -1019,7 +1023,7 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s
{
bits256 auxhash2,prevhash2; struct iguana_msgtx *tx; struct iguana_msgmerkle *coinbase_branch=0,*blockchain_branch=0; struct iguana_msgblock parentblock;
if ( rawmem->totalsize == 0 )
iguana_meminit(rawmem,"bighdrs",0,IGUANA_MAXPACKETSIZE * 2,0);
iguana_meminit(rawmem,"bighdrs",0,IGUANA_MAXPACKETSIZE * 3,0);
memset(prevhash2.bytes,0,sizeof(prevhash2));
zblocks = mycalloc('z',1,(int32_t)(sizeof(struct iguana_zblock) * n));
//printf("%s got %d headers len.%d\n",coin->symbol,n,recvlen);
@ -1059,7 +1063,6 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s
free(blockchain_branch);
if ( iguana_gotheadersM(coin,addr,zblocks,n) < 0 )
myfree(zblocks,(int32_t)(sizeof(struct iguana_zblock) * n));
//myfree(blocks,sizeof(*blocks) * n);
if ( len == recvlen && addr != 0 )
addr->msgcounts.headers++;
} else printf("got unexpected n.%d for headers\n",n);

78
iguana/iguana_notary.c

@ -32,20 +32,20 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3
void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,struct dpow_checkpoint tip)
{
int32_t i,ind; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE]; char str[65];
int32_t i,ind; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE];
memset(newfifo,0,sizeof(newfifo));
for (i=DPOW_FIFOSIZE-1; i>0; i--)
{
if ( bits256_nonz(fifo[i-1].blockhash.hash) != 0 && (tip.blockhash.height - fifo[i-1].blockhash.height) != i )
if ( 0 && bits256_nonz(fifo[i-1].blockhash.hash) != 0 && (tip.blockhash.height - fifo[i-1].blockhash.height) != i )
printf("(%d != %d) ",(tip.blockhash.height - fifo[i-1].blockhash.height),i);
if ( (ind= (tip.blockhash.height - fifo[i-1].blockhash.height)) >= 0 && ind < DPOW_FIFOSIZE )
newfifo[ind] = fifo[i-1];
}
newfifo[0] = tip;
memcpy(fifo,newfifo,sizeof(newfifo));
for (i=0; i<DPOW_FIFOSIZE; i++)
printf("%d ",bits256_nonz(fifo[i].blockhash.hash));
printf(" <- fifo %s\n",bits256_str(str,tip.blockhash.hash));
//for (i=0; i<DPOW_FIFOSIZE; i++)
// printf("%d ",bits256_nonz(fifo[i].blockhash.hash));
//printf(" <- fifo %s\n",bits256_str(str,tip.blockhash.hash));
}
void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *checkpoint,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
@ -58,17 +58,27 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che
void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
{
void **ptrs; char str[65]; struct dpow_checkpoint checkpoint;
void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t freq,minsigs;
dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime);
checkpoint = dp->srcfifo[dp->srcconfirms];
printf("%s srcupdate ht.%d destupdated.%u nonz.%d %s\n",dp->symbol,height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash));
if ( strcmp("BTC",dp->dest) == 0 )
{
freq = DPOW_CHECKPOINTFREQ;
minsigs = DPOW_MINSIGS;
}
else
{
freq = 1;
minsigs = 2;
}
printf("%s src ht.%d dest.%u nonz.%d %s\n",dp->symbol,height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash));
dpow_fifoupdate(myinfo,dp->srcfifo,dp->last);
if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % DPOW_CHECKPOINTFREQ) == 0 )
if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 )
{
ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint));
ptrs[0] = (void *)myinfo;
ptrs[1] = (void *)dp;
ptrs[2] = (void *)DPOW_MINSIGS;
ptrs[2] = (void *)(uint64_t)minsigs;
ptrs[3] = (void *)DPOW_DURATION;
ptrs[4] = 0;
memcpy(&ptrs[5],&checkpoint,sizeof(checkpoint));
@ -114,32 +124,31 @@ void dpow_destconfirm(struct supernet_info *myinfo,struct dpow_info *dp,struct d
void dpow_destupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
{
printf("%s destupdate ht.%d\n",dp->dest,height);
dp->destupdated = timestamp;
dpow_checkpointset(myinfo,&dp->destchaintip,height,hash,timestamp,blocktime);
dpow_approvedset(myinfo,dp,&dp->destchaintip,dp->desttx,dp->numdesttx);
dpow_fifoupdate(myinfo,dp->destfifo,dp->destchaintip);
if ( strcmp(dp->dest,"BTC") == 0 )
dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_BTCCONFIRMS]);
else
{
dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_KOMODOCONFIRMS * 2]); // todo: change to notarized KMD depth
printf("%s destupdate ht.%d\n",dp->dest,height);
dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_BTCCONFIRMS]);
}
else dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_KOMODOCONFIRMS*2]); // todo: change to notarized KMD depth
}
void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp)
{
int32_t height; char str[65]; uint32_t blocktime; bits256 blockhash; struct iguana_info *src,*dest;
int32_t height; uint32_t blocktime; bits256 blockhash; struct iguana_info *src,*dest;
dpow_nanomsg_update(myinfo);
src = iguana_coinfind(dp->symbol);
dest = iguana_coinfind(dp->dest);
//printf("dp.%p dPoWupdate (%s -> %s)\n",dp,dp!=0?dp->symbol:"",dp!=0?dp->dest:"");
//fprintf(stderr,"dp.%p dPoWupdate (%s -> %s)\n",dp,dp!=0?dp->symbol:"",dp!=0?dp->dest:"");
if ( src != 0 && dest != 0 )
{
dp->numdesttx = sizeof(dp->desttx)/sizeof(*dp->desttx);
if ( (height= dpow_getchaintip(myinfo,&blockhash,&blocktime,dp->desttx,&dp->numdesttx,dest)) != dp->destchaintip.blockhash.height && height >= 0 )
{
printf("%s %s height.%d vs last.%d\n",dp->dest,bits256_str(str,blockhash),height,dp->destchaintip.blockhash.height);
//printf("%s %s height.%d vs last.%d\n",dp->dest,bits256_str(str,blockhash),height,dp->destchaintip.blockhash.height);
if ( height <= dp->destchaintip.blockhash.height )
{
printf("iguana_dPoWupdate dest.%s reorg detected %d vs %d\n",dp->dest,height,dp->destchaintip.blockhash.height);
@ -150,7 +159,9 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp)
dp->numsrctx = sizeof(dp->srctx)/sizeof(*dp->srctx);
if ( (height= dpow_getchaintip(myinfo,&blockhash,&blocktime,dp->srctx,&dp->numsrctx,src)) != dp->last.blockhash.height && height >= 0 )
{
printf("%s %s height.%d vs last.%d\n",dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height);
if ( strcmp(dp->dest,"KMD") == 0 )
dp->SRCHEIGHT = dpow_issuer_iteration(dp,src,dp->SRCHEIGHT,&dp->SRCREALTIME);
//printf("%s %s height.%d vs last.%d\n",dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height);
if ( height < dp->last.blockhash.height )
{
printf("iguana_dPoWupdate src.%s reorg detected %d vs %d approved.%d notarized.%d\n",dp->symbol,height,dp->last.blockhash.height,dp->approved[0].height,dp->notarized[0].height);
@ -213,7 +224,12 @@ TWO_STRINGS(iguana,dpow,symbol,pubkey)
if ( strcmp(symbol,myinfo->DPOWS[i].symbol) == 0 )
return(clonestr("{\"error\":\"cant dPoW same coin again\"}"));
}
decode_hex(dp->minerkey33,33,pubkey);
char tmp[67];
safecopy(tmp,pubkey,sizeof(tmp));
decode_hex(dp->minerkey33,33,tmp);
for (i=0; i<33; i++)
printf("%02x",dp->minerkey33[i]);
printf(" DPOW with pubkey.(%s)\n",tmp);
if ( bitcoin_pubkeylen(dp->minerkey33) <= 0 )
return(clonestr("{\"error\":\"illegal pubkey\"}"));
strcpy(dp->symbol,symbol);
@ -236,6 +252,7 @@ TWO_STRINGS(iguana,dpow,symbol,pubkey)
}
myinfo->numdpows++;
PAX_init();
portable_mutex_init(&dp->mutex);
return(clonestr("{\"result\":\"success\"}"));
}
@ -267,6 +284,31 @@ TWO_STRINGS(komodo,passthru,function,hex)
else return(clonestr("{\"error\":\"KMD not active, start in bitcoind mode\"}"));
}
THREE_STRINGS(iguana,passthru,asset,function,hex)
{
if ( asset != 0 && (coin= iguana_coinfind(asset)) != 0 )
return(dpow_passthru(coin,function,hex));
else return(clonestr("{\"error\":\"assetchain not active, start in bitcoind mode\"}"));
}
STRING_ARG(dpow,pending,fiat)
{
struct dpow_info *dp; char base[64]; int32_t i;
if ( fiat != 0 && fiat[0] != 0 )
{
for (i=0; fiat[i]!=0; i++)
base[i] = toupper(fiat[i]);
base[i] = 0;
for (i=0; i<myinfo->numdpows; i++)
{
dp = &myinfo->DPOWS[i];
if ( strcmp(dp->symbol,base) == 0 )
return(jprint(dpow_withdraws_pending(dp),1));
}
}
return(clonestr("[]"));
}
STRING_ARG(iguana,addnotary,ipaddr)
{
static int32_t didinit;

99
iguana/iguana_peers.c

@ -367,14 +367,14 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port)
}
saddr.sin_family = AF_INET;
saddr.sin_port = htons(port);
//#ifdef WIN32
// saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1");
//#else
//#ifdef WIN32
// saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1");
//#else
memcpy(&saddr.sin_addr.s_addr,hostent->h_addr_list[0],hostent->h_length);
expand_ipbits(checkipaddr,saddr.sin_addr.s_addr);
if ( strcmp(ipaddr,checkipaddr) != 0 )
printf("bindflag.%d iguana_socket mismatch (%s) -> (%s)?\n",bindflag,checkipaddr,ipaddr);
//#endif
//#endif
if ( (sock= socket(AF_INET,SOCK_STREAM,0)) < 0 )
{
if ( errno != ETIMEDOUT )
@ -434,7 +434,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port)
}
sleep(13);
//continue;
}
}
if ( errno != ECONNRESET && errno != ENOTCONN && errno != ECONNREFUSED && errno != ETIMEDOUT && errno != EHOSTUNREACH )
{
printf("%s(%s) port.%d failed: %s sock.%d. errno.%d\n",bindflag!=0?"bind":"connect",hostname,port,strerror(errno),sock,errno);
@ -505,30 +505,30 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s
#ifdef _WIN32
if ( (numsent= (int32_t)send(usock,serialized,remains,0)) < 0 )
#else
if ( (numsent= (int32_t)send(usock,serialized,remains,MSG_NOSIGNAL)) < 0 )
if ( (numsent= (int32_t)send(usock,serialized,remains,MSG_NOSIGNAL)) < 0 )
#endif
{
if ( errno == EAGAIN || errno == EWOULDBLOCK )
{
//addr->persistent_peer = 1;
sleep(1);
continue;
if ( errno == EAGAIN || errno == EWOULDBLOCK )
{
//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);
}
}
//if ( errno != EAGAIN && errno != EWOULDBLOCK )
else if ( remains > 0 )
{
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);
remains -= numsent;
serialized += numsent;
if ( remains > 0 )
printf("%s iguana sent.%d remains.%d of len.%d\n",addr->ipaddr,numsent,remains,len);
}
}
else if ( remains > 0 )
{
remains -= numsent;
serialized += numsent;
if ( remains > 0 )
printf("%s iguana sent.%d remains.%d of len.%d\n",addr->ipaddr,numsent,remains,len);
}
}
addr->totalsent += len;
if ( 0 && addr->basilisk != 0 )
@ -562,7 +562,7 @@ int32_t iguana_queue_send(struct iguana_peer *addr,int32_t delay,uint8_t *serial
memcpy(packet->serialized,serialized,datalen);
if ( 0 && addr->supernet != 0 )
printf("%p queue send.(%s) %d to (%s)\n",packet,serialized+4,datalen,addr->ipaddr);
queue_enqueue("sendQ",&addr->sendQ,&packet->DL,0);
queue_enqueue("sendQ",&addr->sendQ,&packet->DL);
return(datalen);
}
@ -598,9 +598,9 @@ int32_t iguana_recv(char *ipaddr,int32_t usock,uint8_t *recvbuf,int32_t len)
void iguana_peer_meminit(struct iguana_info *coin,struct iguana_peer *addr)
{
if ( addr->RAWMEM.ptr == 0 )
iguana_meminit(&addr->RAWMEM,addr->ipaddr,0,IGUANA_MAXPACKETSIZE * 2,0);
iguana_meminit(&addr->RAWMEM,addr->ipaddr,0,IGUANA_MAXPACKETSIZE * 3,0);
if ( addr->TXDATA.ptr == 0 )
iguana_meminit(&addr->TXDATA,"txdata",0,IGUANA_MAXPACKETSIZE * 2,0);
iguana_meminit(&addr->TXDATA,"txdata",0,IGUANA_MAXPACKETSIZE * 3,0);
if ( addr->HASHMEM.ptr == 0 )
iguana_meminit(&addr->HASHMEM,"HASHPTRS",0,256,0);//IGUANA_MAXPACKETSIZE*16,0);
//printf("Init %s memory %p %p %p\n",addr->ipaddr,addr->RAWMEM.ptr,addr->TXDATA.ptr,addr->HASHMEM.ptr);
@ -691,7 +691,7 @@ void _iguana_processmsg(struct supernet_info *myinfo,struct iguana_info *coin,in
}
//addr->dead = 1;
}
// printf("%s recv error on hdr errno.%d (%s) -> zombify\n",addr->ipaddr,-recvlen,strerror(-recvlen));
// printf("%s recv error on hdr errno.%d (%s) -> zombify\n",addr->ipaddr,-recvlen,strerror(-recvlen));
#ifndef IGUANA_DEDICATED_THREADS
addr->dead = 1;
#endif
@ -892,10 +892,10 @@ void *iguana_iAddriterator(struct iguana_info *coin,struct iguana_iAddr *iA,stru
//else printf("connector null iA\n");
return(0);
}
uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr)
{
char checkaddr[64],_ipaddr[64]; uint64_t ipbits; uint32_t now = (uint32_t)time(NULL); int32_t i,n; struct iguana_iAddr *iA; struct iguana_peer *addr;
char checkaddr[64],_ipaddr[64]; uint64_t ipbits; uint32_t now = (uint32_t)time(NULL); int32_t i,n; struct iguana_iAddr *iA; struct iguana_peer *addr; struct stritem *sitem;
if ( coin->virtualchain != 0 || coin->peers == 0 )
return(0);
if ( ipaddr != 0 && ipaddr[0] != 0 && coin->peers != 0 )
@ -909,15 +909,15 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr)
return(0);
}
//printf("%s Q possible.(%s)\n",coin->symbol,ipaddr);
queue_enqueue("possibleQ",&coin->possibleQ,queueitem(ipaddr),1);
queue_enqueue("possibleQ",&coin->possibleQ,queueitem(ipaddr));
return((uint32_t)time(NULL));
}
else if ( iguana_pendingaccept(coin) != 0 )
return((uint32_t)time(NULL));
else if ( (ipaddr= queue_dequeue(&coin->possibleQ,1)) == 0 )
else if ( (sitem= queue_dequeue(&coin->possibleQ)) == 0 )
return((uint32_t)time(NULL));
safecopy(_ipaddr,ipaddr,sizeof(_ipaddr));
free_queueitem(ipaddr);
safecopy(_ipaddr,sitem->str,sizeof(_ipaddr));
free(sitem);
ipaddr = _ipaddr;
#ifdef IGUANA_DISABLEPEERS
if ( strcmp(ipaddr,"127.0.0.1") != 0 )
@ -927,12 +927,12 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr)
if ( (addr= iguana_peerslot(coin,(uint32_t)ipbits,0)) == 0 )
return((uint32_t)time(NULL));
/*for (i=n=0; i<IGUANA_MAXPEERS; i++)
{
if ( strcmp(ipaddr,coin->peers->active[i].ipaddr) == 0 )
return((uint32_t)time(NULL));
else if ( coin->peers->active[i].ipaddr[0] != 0 )
n++;
}*/
{
if ( strcmp(ipaddr,coin->peers->active[i].ipaddr) == 0 )
return((uint32_t)time(NULL));
else if ( coin->peers->active[i].ipaddr[0] != 0 )
n++;
}*/
n = coin->peers->numranked;
if ( n >= coin->MAXPEERS-(coin->MAXPEERS>>3)-1 || coin->peers->numranked >= coin->MAXPEERS )
return((uint32_t)time(NULL));
@ -985,7 +985,7 @@ void iguana_processmsg(void *ptr)
int32_t iguana_pollsendQ(struct iguana_info *coin,struct iguana_peer *addr)
{
struct iguana_packet *packet;
if ( (packet= queue_dequeue(&addr->sendQ,0)) != 0 )
if ( (packet= queue_dequeue(&addr->sendQ)) != 0 )
{
if ( 0 && (addr->supernet != 0 || strcmp((char *)&packet->serialized[4],"SuperNET") == 0) )
printf("%s: send.(%s).%d usock.%d dead.%u ready.%u supernet.%d\n",addr->ipaddr,packet->serialized+4,packet->datalen,addr->usock,addr->dead,addr->ready,addr->supernet);
@ -1003,7 +1003,7 @@ int32_t iguana_pollsendQ(struct iguana_info *coin,struct iguana_peer *addr)
else
{
//printf("embargo.x %llu %f\n",(long long)packet->embargo.x,tai_diff(packet->embargo,tai_now()));
queue_enqueue("embargo",&addr->sendQ,&packet->DL,0);
queue_enqueue("embargo",&addr->sendQ,&packet->DL);
}
}
return(0);
@ -1144,6 +1144,7 @@ int32_t iguana_vinsfname(struct iguana_info *coin,int32_t roflag,char *fname,int
if ( roflag != 0 )
sprintf(fname,"%s/ro/%s/purgeable/%04d.vins",coin->VALIDATEDIR,coin->symbol,slotid);
else sprintf(fname,"%s/%s/%04d.vins",coin->VALIDATEDIR,coin->symbol,slotid);
OS_compatible_path(fname);
return((int32_t)strlen(fname));
}
@ -1202,12 +1203,12 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin,
iguana_memreset(mem[i]);
}
#endif
//addr->pubkey = GENESIS_PUBKEY;
//addr->pubkey = GENESIS_PUBKEY;
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;
bufsize = IGUANA_MAXPACKETSIZE;
bufsize = IGUANA_MAXPACKETSIZE * 2;
if ( addr->blockspace == 0 )
addr->blockspace = mycalloc('r',1,bufsize + 8192);
buf = mycalloc('r',1,bufsize);
@ -1226,7 +1227,7 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin,
run = 0;
while ( addr->usock >= 0 && addr->dead == 0 && coin->peers->shuttingdown == 0 )
{
if ( (req= queue_dequeue(&coin->cacheQ,0)) != 0 )
if ( (req= queue_dequeue(&coin->cacheQ)) != 0 )
{
if ( req->datalen != 0 )
{
@ -1292,10 +1293,10 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin,
if ( flag != 0 )
run = 0;
/*else if ( 0 && addr->supernet != 0 && time(NULL) > lastping+SUPERNET_PINGGAP )
{
iguana_send_supernet(addr,SUPERNET_GETPEERSTR,0);
lastping = (uint32_t)time(NULL);
}*/
{
iguana_send_supernet(addr,SUPERNET_GETPEERSTR,0);
lastping = (uint32_t)time(NULL);
}*/
if ( addr->persistent_peer != 0 )
{
if ( addr->usock < 0 || addr->dead != 0 )

101
iguana/iguana_ramchain.c

@ -1030,10 +1030,13 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits
return(-1);
}
OS_compatible_path(fname);
#ifdef __PNACL__
//static portable_mutex_t mutex;
//portable_mutex_lock(&mutex);
#endif
/*static portable_mutex_t mutex; static int didinit;
if ( didinit == 0 )
{
portable_mutex_init(&mutex);
didinit = 1;
}
portable_mutex_lock(&mutex);*/
if ( (fp= fopen(fname,"wb")) == 0 )
printf("iguana_ramchain_save: couldnt create.(%s) errno.%d\n",fname,errno);
else if ( coin->peers != 0 )
@ -1057,9 +1060,7 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits
fclose(fp);
//sleep(3);
}
#ifdef __PNACL__
//portable_mutex_unlock(&mutex);
#endif
return(fpos);
}
@ -1321,6 +1322,8 @@ int32_t iguana_ramchain_extras(struct supernet_info *myinfo,struct iguana_info *
int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramchain,struct iguana_bundle *bp)
{
int32_t iter; bits256 sha256; char str[65],fname[1024]; void *ptr; long filesize;
if ( ramchain->Xspendinds != 0 )
return(ramchain->numXspends);
for (iter=0; iter<2; iter++)
{
sprintf(fname,"%s/%s%s/spends/%s.%d",GLOBAL_DBDIR,iter==0?"ro/":"",coin->symbol,bits256_str(str,bp->hashes[0]),bp->bundleheight);
@ -1341,10 +1344,10 @@ int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramcha
printf("[%d] filesize %ld Xspendptr.%p %p num.%d\n",bp->hdrsi,filesize,ramchain->Xspendptr,ramchain->Xspendinds,ramchain->numXspends);
bp->Xvalid = 1;
}
//printf("mapped utxo vector[%d] from (%s)\n",ramchain->numXspends,fname);
return(ramchain->numXspends);
//int32_t i; for (i=0; i<ramchain->numXspends; i++)
// printf("(%d u%d) ",ramchain->Xspendinds[i].hdrsi,ramchain->Xspendinds[i].ind);
//printf("mapped utxo vector[%d] from (%s)\n",ramchain->numXspends,fname);
}
else
{
@ -1495,7 +1498,7 @@ struct iguana_ramchain *_iguana_ramchain_map(struct supernet_info *myinfo,struct
return(0);
}
struct iguana_ramchain *iguana_ramchain_map(struct supernet_info *myinfo,struct iguana_info *coin,char *fname,struct iguana_bundle *bp,int32_t numblocks,struct iguana_ramchain *ramchain,struct OS_memspace *hashmem,uint32_t ipbits,bits256 hash2,bits256 prevhash2,int32_t bundlei,long fpos,int32_t allocextras,int32_t expanded)
struct iguana_ramchain *iguana_ramchain_map(struct supernet_info *myinfo,struct iguana_info *coin,char *fname,struct iguana_bundle *bp,int32_t numblocks,struct iguana_ramchain *ramchain,struct OS_memspace *hashmem,uint32_t ipbits,bits256 hash2,bits256 prevhash2,int32_t bundlei,long fpos,int32_t allocextras,int32_t expanded,uint8_t zcash)
{
struct iguana_ramchain *retptr;
#ifdef __PNACL__
@ -1503,7 +1506,7 @@ struct iguana_ramchain *iguana_ramchain_map(struct supernet_info *myinfo,struct
//portable_mutex_lock(&mutex);
#endif
ramchain->height = bp->bundleheight;
retptr = _iguana_ramchain_map(myinfo,coin,fname,bp,numblocks,ramchain,hashmem,ipbits,hash2,prevhash2,bundlei,fpos,allocextras,expanded,coin->chain->zcash);
retptr = _iguana_ramchain_map(myinfo,coin,fname,bp,numblocks,ramchain,hashmem,ipbits,hash2,prevhash2,bundlei,fpos,allocextras,expanded,zcash);
#ifdef __PNACL__
//portable_mutex_unlock(&mutex);
#endif
@ -1817,23 +1820,24 @@ int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info
return(0);
}
long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,int32_t txn_count,uint8_t *data,int32_t recvlen,struct iguana_bundle *bp,struct iguana_block *block)
long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,int32_t txn_count,uint8_t *data,int32_t recvlen,struct iguana_bundle *bp,struct iguana_block *block,uint8_t zcash)
{
int32_t verifyflag = 0;
RAMCHAIN_DECLARE; struct iguana_ramchain R,*mapchain,*ramchain = &addr->ramchain; struct iguana_msgtx *tx; char fname[1024]; uint8_t rmd160[20]; struct iguana_ramchaindata *rdata; int32_t i,j,fpos,pubkeysize,sigsize,subdir,firsti=1,err,flag,bundlei; uint32_t scriptspace,stackspace; struct iguana_blockRO RO;
RAMCHAIN_DECLARE; struct iguana_ramchain R,*mapchain,*ramchain = &addr->ramchain; struct iguana_msgtx *tx; char fname[1024]; uint8_t rmd160[20]; struct iguana_ramchaindata *rdata; int32_t i,j,fpos,pubkeysize,sigsize,hdrsi,subdir,firsti=1,err,flag,bundlei=-1; uint32_t scriptspace,stackspace; struct iguana_blockRO RO;
if ( block == 0 || bp == 0 || addr == 0 || (block != 0 && (bundlei= block->bundlei) < 0) )
{
//printf("iguana_ramchain_data: null ptr %p %p %p\n",block,bp,addr);
//printf("iguana_ramchain_data: null ptr %p %p %p bundlei.%d\n",block,bp,addr,bundlei);
return(-1);
}
#ifdef __PNACL__
//verifyflag = 1;
#endif
iguana_peerfname(coin,&hdrsi,GLOBAL_TMPDIR,fname,0,origtxdata->zblock.RO.hash2,origtxdata->zblock.RO.prev_block,1,0);
sigsize = pubkeysize = 0;
scriptspace = 1;//iguana_scriptspaceraw(coin,&scriptsize,&sigsize,&pubkeysize,txarray,txn_count);
for (i=0; i<sizeof(addr->dirty)/sizeof(*addr->dirty); i++)
addr->dirty[i] = 0;
if ( iguana_ramchain_init(fname,ramchain,&addr->TXDATA,&addr->HASHMEM,1,txn_count,origtxdata->numunspents,origtxdata->numspends,0,0,(scriptspace+sigsize+pubkeysize)*1.1,0,1,coin->chain->zcash) == 0 )
if ( iguana_ramchain_init(fname,ramchain,&addr->TXDATA,&addr->HASHMEM,1,txn_count,origtxdata->numunspents,origtxdata->numspends,0,0,(scriptspace+sigsize+pubkeysize)*1.1,0,1,zcash) == 0 )
{
if ( block != 0 && block->fpipbits == 0 )
block->issued = block->RO.recvlen = 0, block->fpos = -1;
@ -1901,7 +1905,7 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,
rdata->prevhash2 = origtxdata->zblock.RO.prev_block;
rdata->scriptspace = scriptspace = ramchain->H.scriptoffset;
rdata->stackspace = stackspace = ramchain->H.stacksize;
iguana_ramchain_setsize(fname,ramchain,rdata,1,coin->chain->zcash);
iguana_ramchain_setsize(fname,ramchain,rdata,1,zcash);
flag = 0;
if ( ramchain->H.txidind != rdata->numtxids || ramchain->H.unspentind != rdata->numunspents || ramchain->H.spendind != rdata->numspends )
{
@ -1917,21 +1921,17 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,
{
if ( (err= iguana_ramchain_verify(coin,ramchain)) == 0 )
{
iguana_blockzcopyRO(coin->chain->zcash,B,0,&RO,0);
*B = RO;
rdata->scriptspace = ramchain->H.scriptoffset = scriptspace;
rdata->stackspace = ramchain->H.stacksize = stackspace;
if ( (fpos= (int32_t)iguana_ramchain_save(coin,RAMCHAIN_ARG,(uint32_t)addr->ipbits,RO.hash2,RO.prev_block,bundlei,0,coin->chain->zcash)) >= 0 )
if ( (fpos= (int32_t)iguana_ramchain_save(coin,RAMCHAIN_ARG,(uint32_t)addr->ipbits,RO.hash2,RO.prev_block,bundlei,0,zcash)) >= 0 )
{
origtxdata->datalen = (int32_t)rdata->allocsize;
//char str[65]; printf("saved.%s [%d:%d] fpos.%d datalen.%d\n",bits256_str(str,block->RO.hash2),bp->hdrsi,bundlei,fpos,origtxdata->datalen);
ramchain->H.ROflag = 0;
flag = 1;
if ( addr->dirty[0] != 0 && addr->voutsfp != 0 )
fflush(addr->voutsfp);
if ( addr->dirty[1] != 0 && addr->vinsfp != 0 )
fflush(addr->vinsfp);
memset(&R,0,sizeof(R));
if ( verifyflag != 0 && (mapchain= iguana_ramchain_map(myinfo,coin,fname,0,1,&R,0,(uint32_t)addr->ipbits,RO.hash2,RO.prev_block,bundlei,fpos,1,0)) == 0 )
if ( verifyflag != 0 && (mapchain= iguana_ramchain_map(myinfo,coin,fname,0,1,&R,&addr->HASHMEM,(uint32_t)addr->ipbits,RO.hash2,RO.prev_block,bundlei,fpos,0,0,zcash)) == 0 )
{
printf("delete unverified [%d:%d]\n",bp->hdrsi,bundlei);
iguana_ramchain_free(coin,&R,1);
@ -1946,7 +1946,7 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,
}
if ( block != 0 && fpos >= 0 )
block->fpos = fpos, block->fpipbits = (uint32_t)addr->ipbits;
} else printf("save error\n");
} //else printf("save error\n");
}
else
{
@ -1955,6 +1955,13 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,
}
}
}
if ( addr != 0 )
{
if ( addr->dirty[0] != 0 && addr->voutsfp != 0 )
fflush(addr->voutsfp);
if ( addr->dirty[1] != 0 && addr->vinsfp != 0 )
fflush(addr->vinsfp);
}
if ( fpos < 0 && block != 0 )
iguana_blockunmark(coin,block,bp,bundlei,1);
//fprintf(stderr,"finished with hdrsi.%d ht.%d scripts.%u:%u\n",bp->hdrsi,bp->bundleheight,ramchain->H.scriptoffset,rdata->scriptspace);
@ -2008,7 +2015,7 @@ void iguana_blockdelete(struct iguana_info *coin,bits256 hash2,int32_t i)
void iguana_blockunmark(struct iguana_info *coin,struct iguana_block *block,struct iguana_bundle *bp,int32_t i,int32_t deletefile)
{
void *ptr; int32_t recvlen,height = -1;
void *ptr; int32_t recvlen,height = -1; uint8_t zcash = 0;
if ( 0 && bp != 0 )
printf("UNMARK.[%d:%d]\n",bp->hdrsi,i);
if ( block != 0 )
@ -2041,7 +2048,7 @@ void iguana_blockunmark(struct iguana_info *coin,struct iguana_block *block,stru
{
printf("reduce %s HWM height from %d to %d\n",coin->symbol,coin->blocks.hwmchain.height,height);
if ( (block= iguana_blockfind("unmark",coin,iguana_blockhash(coin,height))) != 0 )
iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,(struct iguana_block *)&coin->blocks.hwmchain,block);
iguana_blockcopy(zcash,coin->chain->auxpow,coin,(struct iguana_block *)&coin->blocks.hwmchain,block);
}
}
@ -2184,7 +2191,7 @@ void iguana_bundlemapfree(struct iguana_info *coin,struct OS_memspace *mem,struc
int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_info *coin,RAMCHAIN_FUNC,struct iguana_ramchain *newchain,struct OS_memspace *hashmem,int32_t cmpflag,struct iguana_bundle *bp)
{
static const bits256 zero;
static const bits256 zero; uint8_t zcash = 0;
bits256 firsthash2; int32_t err,bundlei,hdrsi,numblocks,firsti,height,retval= -1; struct iguana_ramchain checkR,*mapchain; char fname[1024]; struct iguana_block *block; uint32_t scriptspace,scriptoffset,stacksize; uint8_t *destoffset,*srcoffset; struct iguana_ramchaindata *rdata;
if ( (rdata= ramchain->H.data) == 0 )
return(-1);
@ -2206,7 +2213,7 @@ int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_
rdata->prevhash2 = block->RO.prev_block;
rdata->scriptspace = scriptoffset;
ramchain->H.stacksize = rdata->stackspace = stacksize;
iguana_ramchain_setsize(fname,ramchain,rdata,bp->n,coin->chain->zcash);
iguana_ramchain_setsize(fname,ramchain,rdata,bp->n,zcash);
//printf("Apresave T.%d U.%d S.%d P.%d X.%d -> size.%ld firsti.%d scriptoffset.%d stacksize.%d\n",rdata->numtxids,rdata->numunspents,rdata->numspends,rdata->numpkinds,rdata->numexternaltxids,(long)rdata->allocsize,firsti,ramchain->H.scriptoffset,ramchain->H.stacksize);
*newchain = *ramchain;
//memcpy(ramchain->roU2,ramchain->U2,sizeof(*ramchain->U2) * rdata->numunspents);
@ -2230,7 +2237,7 @@ int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_
ramchain->H.scriptoffset = scriptoffset;
rdata->scriptspace = scriptoffset;
ramchain->H.stacksize = rdata->stackspace = stacksize;
if ( iguana_ramchain_save(coin,RAMCHAIN_ARG,0,firsthash2,zero,0,bp,coin->chain->zcash) < 0 )
if ( iguana_ramchain_save(coin,RAMCHAIN_ARG,0,firsthash2,zero,0,bp,zcash) < 0 )
{
printf("ERROR saving ramchain hdrsi.%d, deleting and will regenerate\n",hdrsi);
iguana_mempurge(hashmem);
@ -2245,7 +2252,7 @@ int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_
bundlei = 0;
if ( cmpflag == 0 )
iguana_memreset(hashmem);
if ( (mapchain= iguana_ramchain_map(myinfo,coin,fname,bp,numblocks,&checkR,cmpflag==0?hashmem:0,0,firsthash2,zero,bundlei,0,0,1)) != 0 )
if ( (mapchain= iguana_ramchain_map(myinfo,coin,fname,bp,numblocks,&checkR,cmpflag==0?hashmem:0,0,firsthash2,zero,bundlei,0,0,1,zcash)) != 0 )
{
iguana_ramchain_link(mapchain,firsthash2,hdrsi,height,0,numblocks,firsti,1);
iguana_ramchain_extras(myinfo,coin,mapchain,hashmem,0);
@ -2277,13 +2284,13 @@ int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_
struct iguana_ramchain *iguana_bundleload(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_ramchain *ramchain,struct iguana_bundle *bp,int32_t extraflag)
{
static const bits256 zero;
static const bits256 zero; uint8_t zcash = 0;
struct iguana_blockRO *B; struct iguana_txid *T; int32_t i,firsti = 1; char fname[512];
struct iguana_block *block,*prev,*prev2; struct iguana_ramchain *mapchain; struct iguana_ramchaindata *rdata; uint32_t firsttxidind;
if ( bp->emitfinish > 1 )
return(ramchain);
memset(ramchain,0,sizeof(*ramchain));
if ( (mapchain= iguana_ramchain_map(myinfo,coin,fname,bp,bp->n,ramchain,0,0,bp->hashes[0],zero,0,0,extraflag,1)) != 0 )
if ( (mapchain= iguana_ramchain_map(myinfo,coin,fname,bp,bp->n,ramchain,0,0,bp->hashes[0],zero,0,0,extraflag,1,zcash)) != 0 )
{
iguana_ramchain_link(mapchain,bp->hashes[0],bp->hdrsi,bp->bundleheight,0,bp->n,firsti,1);
//char str[65]; printf("%s bp.%d: T.%d U.%d S.%d P%d X.%d MAPPED %s %p\n",coin->symbol,bp->hdrsi,mapchain->H.data->numtxids,mapchain->H.data->numunspents,mapchain->H.data->numspends,mapchain->H.data->numpkinds,mapchain->H.data->numexternaltxids,mbstr(str,mapchain->H.data->allocsize),mapchain->H.data);
@ -2310,7 +2317,7 @@ struct iguana_ramchain *iguana_bundleload(struct supernet_info *myinfo,struct ig
block->hdrsi = bp->hdrsi;
block->bundlei = i;
block->fpipbits = (uint32_t)calc_ipbits("127.0.0.1");
iguana_blockzcopyRO(coin->chain->zcash,&block->RO,0,B,i);
iguana_blockzcopyRO(zcash,&block->RO,0,B,i);
//printf("%x ",(int32_t)B[i].hash2.ulongs[3]);
bp->blocks[i] = block;
bp->hashes[i] = block->RO.hash2;
@ -2356,7 +2363,7 @@ struct iguana_ramchain *iguana_bundleload(struct supernet_info *myinfo,struct ig
int64_t iguana_ramchainopen(struct supernet_info *myinfo,char *fname,struct iguana_info *coin,struct iguana_ramchain *ramchain,struct OS_memspace *mem,struct OS_memspace *hashmem,int32_t bundleheight,bits256 hash2)
{
RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; int32_t i,numblocks = coin->chain->bundlesize; uint32_t numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata=0; int64_t hashsize,allocsize;
RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; uint8_t zcash = 0; int32_t i,numblocks = coin->chain->bundlesize; uint32_t numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata=0; int64_t hashsize,allocsize;
//B = 0, Ux = 0, Sx = 0, P = 0, A = 0, X = 0, Kspace = TXbits = PKbits = 0, U = 0, S = 0, T = 0;
mem->alignflag = sizeof(uint32_t);
hashmem->alignflag = sizeof(uint32_t);
@ -2384,7 +2391,7 @@ int64_t iguana_ramchainopen(struct supernet_info *myinfo,char *fname,struct igua
//#endif
if ( mem->ptr == 0 )
{
while ( (allocsize= _iguana_rdata_action(fname,0,0,0,0,1,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,0,0,0,0,0,RAMCHAIN_ARG,numblocks,coin->chain->zcash)) > 2*1024LL*1024L*1024L )
while ( (allocsize= _iguana_rdata_action(fname,0,0,0,0,1,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,0,0,0,0,0,RAMCHAIN_ARG,numblocks,zcash)) > 2*1024LL*1024L*1024L )
{
numtxids *= .9;
numunspents *= .9;
@ -2401,7 +2408,7 @@ int64_t iguana_ramchainopen(struct supernet_info *myinfo,char *fname,struct igua
iguana_meminit(hashmem,coin->symbol,0,hashsize + 65536*3,0);
printf("%s hash meminit %lld\n",coin->symbol,(long long)hashmem->totalsize);
}
if ( iguana_ramchain_init(fname,ramchain,mem,hashmem,1,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,1,numblocks,coin->chain->zcash) > 0 )
if ( iguana_ramchain_init(fname,ramchain,mem,hashmem,1,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,1,numblocks,zcash) > 0 )
{
iguana_ramchain_link(ramchain,hash2,bundleheight/coin->chain->bundlesize,bundleheight,0,0,1,0);
ramchain->expanded = 1;
@ -2417,7 +2424,7 @@ int64_t iguana_ramchainopen(struct supernet_info *myinfo,char *fname,struct igua
int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_ramchain *mapchain,struct iguana_bundle *bp,int32_t bundlei,struct iguana_block *block,void *ptr,long filesize)
{
int32_t firsti = 1; RAMCHAIN_DECLARE;
int32_t firsti = 1; RAMCHAIN_DECLARE; uint8_t zcash = 0;
memset(mapchain,0,sizeof(*mapchain));
mapchain->fileptr = ptr;
mapchain->filesize = filesize;
@ -2429,9 +2436,9 @@ int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_r
return(-1);
}
_iguana_ramchain_setptrs(MAPCHAIN_PTRS,mapchain->H.data);
if ( block->fpos+mapchain->H.data->allocsize > filesize || iguana_ramchain_size(fname,MAPCHAIN_ARG,1,mapchain->H.data->scriptspace,coin->chain->zcash) != mapchain->H.data->allocsize )
if ( block->fpos+mapchain->H.data->allocsize > filesize || iguana_ramchain_size(fname,MAPCHAIN_ARG,1,mapchain->H.data->scriptspace,zcash) != mapchain->H.data->allocsize )
{
printf("iguana_mapchaininit.%d ipbits.%x size mismatch %ld vs %ld vs filesize.%ld fpos.%ld bundlei.%d expanded.%d soff.%d\n",bp->bundleheight,block->fpipbits,(long)iguana_ramchain_size(fname,MAPCHAIN_ARG,1,mapchain->H.data->scriptspace,coin->chain->zcash),(long)mapchain->H.data->allocsize,(long)filesize,(long)block->fpos,bundlei,mapchain->expanded,mapchain->H.data->scriptspace);
printf("iguana_mapchaininit.%d ipbits.%x size mismatch %ld vs %ld vs filesize.%ld fpos.%ld bundlei.%d expanded.%d soff.%d\n",bp->bundleheight,block->fpipbits,(long)iguana_ramchain_size(fname,MAPCHAIN_ARG,1,mapchain->H.data->scriptspace,zcash),(long)mapchain->H.data->allocsize,(long)filesize,(long)block->fpos,bundlei,mapchain->expanded,mapchain->H.data->scriptspace);
//getchar();
return(-1);
}
@ -2449,7 +2456,7 @@ int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_r
// helper threads: NUM_HELPERS
int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coin,struct OS_memspace *mem,struct OS_memspace *memB,struct iguana_bundle *bp,uint32_t starttime) // helper thread
{
static int depth;
static int depth; uint8_t zcash = 0;
RAMCHAIN_DESTDECLARE; RAMCHAIN_DECLARE; RAMCHAIN_ZEROES;
void **ptrs; long *filesizes; uint32_t *ipbits; char fname[1024];
struct iguana_ramchain *R,*mapchain,*dest,newchain; uint32_t fpipbits; bits256 prevhash2;
@ -2532,7 +2539,7 @@ int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coi
numexternaltxids = numspends;
//printf("E.%d depth.%d start bundle ramchain %d at %u started.%u lag.%d\n",coin->numemitted,depth,bp->bundleheight,now,starttime,now-starttime);
depth++;
if ( iguana_ramchain_alloc(fname,coin,dest,mem,&HASHMEM,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace+sigspace,bp->bundleheight+starti,bp_n,coin->chain->zcash) < 0 )
if ( iguana_ramchain_alloc(fname,coin,dest,mem,&HASHMEM,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace+sigspace,bp->bundleheight+starti,bp_n,zcash) < 0 )
{
printf("error iguana_ramchain_alloc for bundleheight.%d\n",bp->bundleheight);
iguana_bundlemapfree(coin,mem,&HASHMEM,ipbits,ptrs,filesizes,num,R,starti,endi);
@ -2561,7 +2568,7 @@ int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coi
iguana_blockunmark(coin,block,bp,i,1);
return(-1);
}
iguana_blockzcopyRO(coin->chain->zcash,destB,i,&block->RO,0);
iguana_blockzcopyRO(zcash,destB,i,&block->RO,0);
//destB[i] = block->RO;
} else printf("bundlesave error getting block (%d:%d) %p vs %p\n",bp->hdrsi,i,block,bp->blocks[i]);
}
@ -2576,9 +2583,9 @@ int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coi
{
iguana_blocksetcounters(coin,block,dest);
//coin->blocks.RO[bp->bundleheight+bundlei] = block->RO;
iguana_blockzcopyRO(coin->chain->zcash,destB,bundlei,&block->RO,0);
iguana_blockzcopyRO(zcash,destB,bundlei,&block->RO,0);
//destB[bundlei] = block->RO;
//fprintf(stderr,"(%d %d).%d ",R[bundlei].H.data->numtxids,dest->H.txidind,bundlei);
//fprintf(stderr,"T.(%d %d u%d).%d ",R[bundlei].H.data->numtxids,dest->H.txidind,R[bundlei].H.data->numunspents,bundlei);
if ( (err= iguana_ramchain_iterate(myinfo,coin,dest,&R[bundlei],bp,bundlei)) != 0 )
{
if ( (block= bp->blocks[bundlei]) != 0 )
@ -2608,7 +2615,7 @@ int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coi
memset(&newchain,0,sizeof(newchain));
if ( bundlei == endi+1 && iguana_ramchain_expandedsave(myinfo,coin,RAMCHAIN_DESTARG,&newchain,&HASHMEM,0,bp) == 0 )
{
//char str[65]; printf("d.%d ht.%d %s saved lag.%d elapsed.%ld\n",depth,dest->height,mbstr(str,dest->H.data->allocsize),now-starttime,time(NULL)-now);
//char str[65]; printf("d.%d ht.%d %s saved\n",depth,dest->height,mbstr(str,dest->H.data->allocsize));
retval = 0;
} else bp->generrs++;
iguana_bundlemapfree(coin,mem,&HASHMEM,ipbits,ptrs,filesizes,num,R,starti,endi);
@ -2657,7 +2664,7 @@ void iguana_mergefree(struct iguana_info *coin,struct OS_memspace *mem,struct ig
int32_t iguana_bundlemergeHT(struct supernet_info *myinfo,char *fname,struct iguana_info *coin,struct OS_memspace *mem,struct OS_memspace *memB,struct iguana_bundle *bp,struct iguana_bundle *nextbp,uint32_t starttime)
{
static int32_t depth; static const bits256 zero;
static int32_t depth; static const bits256 zero; uint8_t zcash = 0;
RAMCHAIN_DESTDECLARE; struct OS_memspace HASHMEM,HASHMEMA,HASHMEMB;
uint32_t now = (uint32_t)time(NULL); char str[65],fnameA[1024],fnameB[1024];
struct iguana_ramchain _Achain,_Bchain,*A,*B,R,newchain,*dest = &R; int32_t err,retval = -1,firsti = 1;
@ -2668,11 +2675,11 @@ int32_t iguana_bundlemergeHT(struct supernet_info *myinfo,char *fname,struct igu
iguana_meminit(&HASHMEMB,"hashmemB",0,iguana_hashmemsize(nextbp->ramchain.H.txidind,nextbp->ramchain.H.unspentind,nextbp->ramchain.H.spendind,nextbp->ramchain.pkind,nextbp->ramchain.externalind,nextbp->ramchain.H.data->scriptspace) + IGUANA_MAXSCRIPTSIZE,0);
memset(&_Achain,0,sizeof(_Achain)); A = &_Achain;
memset(&_Bchain,0,sizeof(_Bchain)); B = &_Bchain;
if ( (A= iguana_ramchain_map(myinfo,coin,fnameA,bp,bp->ramchain.numblocks,A,&HASHMEMA,0,bp->hashes[0],zero,0,0,1,1)) != 0 )
if ( (A= iguana_ramchain_map(myinfo,coin,fnameA,bp,bp->ramchain.numblocks,A,&HASHMEMA,0,bp->hashes[0],zero,0,0,1,1,zcash)) != 0 )
{
iguana_ramchain_link(A,bp->hashes[0],bp->hdrsi,bp->bundleheight,0,bp->ramchain.numblocks,firsti,1);
}
if ( (B= iguana_ramchain_map(myinfo,coin,fnameB,bp,nextbp->ramchain.numblocks,B,&HASHMEMB,0,nextbp->hashes[0],zero,0,0,1,1)) != 0 )
if ( (B= iguana_ramchain_map(myinfo,coin,fnameB,bp,nextbp->ramchain.numblocks,B,&HASHMEMB,0,nextbp->hashes[0],zero,0,0,1,1,zcash)) != 0 )
{
iguana_ramchain_link(B,bp->hashes[0],nextbp->hdrsi,nextbp->bundleheight,0,nextbp->ramchain.numblocks,firsti,1);
}
@ -2684,7 +2691,7 @@ int32_t iguana_bundlemergeHT(struct supernet_info *myinfo,char *fname,struct igu
}
if ( A->H.data != 0 && B->H.data != 0 && B->height == A->height+A->numblocks )
{
if ( iguana_ramchain_alloc(fname,coin,dest,mem,&HASHMEM,(A->H.data->numtxids+B->H.data->numtxids),(A->H.data->numunspents+B->H.data->numunspents),(A->H.data->numspends+B->H.data->numspends),(A->H.data->numpkinds+B->H.data->numpkinds),(A->H.data->numexternaltxids+B->H.data->numexternaltxids),A->H.data->scriptspace,A->height,A->numblocks + B->numblocks,coin->chain->zcash) < 0 )
if ( iguana_ramchain_alloc(fname,coin,dest,mem,&HASHMEM,(A->H.data->numtxids+B->H.data->numtxids),(A->H.data->numunspents+B->H.data->numunspents),(A->H.data->numspends+B->H.data->numspends),(A->H.data->numpkinds+B->H.data->numpkinds),(A->H.data->numexternaltxids+B->H.data->numexternaltxids),A->H.data->scriptspace,A->height,A->numblocks + B->numblocks,zcash) < 0 )
{
printf("depth.%d ht.%d fsize.%s ERROR alloc lag.%d elapsed.%d\n",depth,dest->height,mbstr(str,dest->H.data->allocsize),now-starttime,(int32_t)(time(NULL)-now));
iguana_mergefree(coin,mem,A,B,&HASHMEM,&HASHMEMA,&HASHMEMB);

106
iguana/iguana_recv.c

@ -25,7 +25,7 @@ struct iguana_bundlereq *iguana_bundlereq(struct iguana_info *coin,struct iguana
struct iguana_bundlereq *req; int32_t allocsize;
if ( data == 0 )
datalen = 0;
allocsize = (uint32_t)sizeof(*req) + datalen;
allocsize = (uint32_t)sizeof(*req) + datalen + 64;
req = mycalloc(type,1,allocsize);
req->allocsize = allocsize;
req->datalen = datalen;
@ -185,7 +185,7 @@ void iguana_gotunconfirmedM(struct iguana_info *coin,struct iguana_peer *addr,st
req->datalen = datalen;
req->txid = tx->txid;
memcpy(req->serializeddata,data,datalen);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
}
#ifdef later
@ -421,7 +421,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s
else
{
iguana_bundletime(coin,bp,bundlei,block,1);
iguana_blockzcopyRO(coin->chain->zcash,&block->RO,0,&origtxdata->zblock.RO,0);
iguana_blockzcopyRO(0*coin->chain->zcash,&block->RO,0,&origtxdata->zblock.RO,0);
block->txvalid = 1;
}
//if ( block->mainchain != 0 )
@ -493,7 +493,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s
addr->recvblocks += 1.;
addr->recvtotal += recvlen;
}
if ( speculative == 0 && iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block) >= 0 )
if ( speculative == 0 && iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block,0) >= 0 )
{
txdata->zblock.fpipbits = (uint32_t)addr->ipbits;
txdata->zblock.RO.recvlen = recvlen;
@ -526,7 +526,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s
}
req->addr = addr;
//if ( (bits256_cmp(origtxdata->zblock.RO.hash2,coin->blocks.hwmchain.RO.hash2) == 0 || req->zblock.mainchain == 0 || req->zblock.valid == 0 || req->zblock.txvalid == 0) && iguana_RTrawdata(coin,origtxdata->zblock.RO.hash2,0,&len,&numtx,1) == 0 )
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
if ( 0 && strcmp("BTCD",coin->symbol) == 0 )
printf("%s Q.(%s)\n",coin->symbol,bits256_str(str,origtxdata->zblock.RO.hash2));
} else printf("nonz fpos.%d %s\n",txdata->zblock.fpos,bits256_str(str,origtxdata->zblock.RO.hash2));
@ -602,7 +602,7 @@ int32_t iguana_bundlestats_update(struct iguana_info *coin,struct iguana_block *
else
{
iguana_bundletime(coin,bp,bundlei,block,1);
iguana_blockzcopyRO(coin->chain->zcash,&block->RO,0,&origtxdata->zblock.RO,0);
iguana_blockzcopyRO(0*coin->chain->zcash,&block->RO,0,&origtxdata->zblock.RO,0);
return(0);
}
}
@ -718,7 +718,7 @@ int32_t iguana_txmerkle(struct iguana_info *coin,bits256 *tree,int32_t treesize,
return(-1);
}
void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,struct iguana_msghdr *H,uint8_t *data,int32_t recvlen,int32_t fromcache)
void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,struct iguana_msghdr *H,uint8_t *data,int32_t recvlen,int32_t fromcache,uint8_t zcash)
{
static uint64_t totalrecv;
struct iguana_bundlereq *req; struct iguana_txblock *txdata = 0; int32_t incr,i,numsaved,valid,speculative=0,bundlei,copyflag,numtx; struct iguana_bundle *bp; struct iguana_block *block; char str[65];
@ -755,7 +755,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
numtx = origtxdata->zblock.RO.txn_count;
iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx);
req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
return;
}
else if ( bundlei < coin->chain->bundlesize-1 )
@ -780,7 +780,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
{
printf("gotblockM no bp %s\n",bits256_str(str,origtxdata->zblock.RO.hash2));
req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
return;
}
for (i=numsaved=0; i<coin->chain->bundlesize; i++)
@ -791,7 +791,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
if ( (speculative= iguana_bundlestats_update(coin,&block,bp,bundlei,origtxdata,data,recvlen)) < 0 )
{
req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
//printf("negative speculative return %s\n",bits256_str(str,origtxdata->zblock.RO.hash2));
return;
}
@ -799,7 +799,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
{
if ( block == 0 )
block = iguana_blockhashset("noblock",coin,bp->bundleheight+bundlei,origtxdata->zblock.RO.hash2,1);
if ( block->hdrsi != bp->hdrsi || block->bundlei != bundlei )
if ( block != 0 && (block->hdrsi != bp->hdrsi || block->bundlei != bundlei) )
{
block->hdrsi = bp->hdrsi;
block->bundlei = bundlei;
@ -819,9 +819,10 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx);
if ( block != 0 )
{
if ( block->height < 0 )
block->bundlei = -1;
block->txvalid = 1;
block->hdrsi = bp->hdrsi;
block->bundlei = bundlei;
block->height = bp->hdrsi*coin->chain->bundlesize + bundlei;
block->txvalid = block->valid = 1;
block->RO.txn_count = origtxdata->zblock.RO.txn_count;
if ( block->fpipbits != 0 && block->fpos >= 0 )
{
@ -838,19 +839,26 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
// printf("DUP s.%d [%d:%d].(%s) %s n%d\n",numsaved,bp!=0?bp->hdrsi:-1,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2),addr->ipaddr,addr->pendblocks);
}
req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
return;
}
}
txdata = origtxdata;
if ( iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block) >= 0 )
/*static portable_mutex_t mutex; static int32_t didinit;
if ( didinit == 0 )
{
portable_mutex_init(&mutex);
didinit = 1;
}
portable_mutex_lock(&mutex);*/
if ( iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block,zcash) >= 0 )
{
txdata->zblock.fpipbits = (uint32_t)addr->ipbits;
txdata->zblock.RO.recvlen = recvlen;
txdata->zblock.fpos = 0;
copyflag = (coin->enableCACHE != 0) && (strcmp(coin->symbol,"BTC") != 0);
req = iguana_recv_bundlereq(coin,addr,copyflag,H,data,recvlen,bp,bundlei,txdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
if ( 0 && bp->hdrsi == 0 && strcmp("SYS",coin->symbol) == 0 )
printf("[%d:%d].s%d %s Q.(%s) %s\n",bp->hdrsi,bundlei,numsaved,coin->symbol,bits256_str(str,origtxdata->zblock.RO.hash2),addr->ipaddr);
if ( numsaved < coin->chain->bundlesize )
@ -886,8 +894,9 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
else
{
req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
}
//portable_mutex_unlock(&mutex);
}
void iguana_gottxidsM(struct iguana_info *coin,struct iguana_peer *addr,bits256 *txids,int32_t n)
@ -896,7 +905,7 @@ void iguana_gottxidsM(struct iguana_info *coin,struct iguana_peer *addr,bits256
//printf("got %d txids from %s\n",n,addr->ipaddr);
req = iguana_bundlereq(coin,addr,'T',0,0);
req->hashes = txids, req->n = n;
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
}
int32_t iguana_gotheadersM(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_zblock *zblocks,int32_t n)
@ -948,7 +957,7 @@ int32_t iguana_gotheadersM(struct iguana_info *coin,struct iguana_peer *addr,str
memcpy(req->blocks,&zblocks[i++ * coin->chain->bundlesize],coin->chain->bundlesize * sizeof(*zblocks));
req->n = coin->chain->bundlesize;
HDRnet++;
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
}
}
else
@ -956,7 +965,7 @@ int32_t iguana_gotheadersM(struct iguana_info *coin,struct iguana_peer *addr,str
req = iguana_bundlereq(coin,addr,'H',0,0);
req->blocks = zblocks, req->n = n;
HDRnet++;
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
zblocks = 0;
}
if ( zblocks != 0 )
@ -984,7 +993,7 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi
char str[65];
if ( 0 && n > 2 && addr != 0 )
printf("addr.%d %s [%d]\n",addr->rank,bits256_str(str,blockhashes[1]),n);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
queue_enqueue("recvQ",&coin->recvQ,&req->DL);
if ( strcmp("BTC",coin->symbol) != 0 )
{
if ( n > coin->chain->bundlesize )
@ -1061,7 +1070,7 @@ void iguana_bundlespeculate(struct iguana_info *coin,struct iguana_bundle *bp,in
char str[65]; bits256_str(str,bp->hashes[0]);
//fprintf(stderr,"Afound block -> %d %d hdr.%s\n",bp->bundleheight,coin->longestchain-coin->chain->bundlesize,str);
bp->hdrtime = (uint32_t)time(NULL);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(str),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(str));
}
}
@ -1150,7 +1159,7 @@ void iguana_hwmchain_set(struct iguana_info *coin,struct iguana_block *block,int
{
if ( block->height == height )
{
iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,(struct iguana_block *)&coin->blocks.hwmchain,block);
iguana_blockcopy(0*coin->chain->zcash,coin->chain->auxpow,coin,(struct iguana_block *)&coin->blocks.hwmchain,block);
char str[65]; printf("SET %s HWM.%s ht.%d\n",coin->symbol,bits256_str(str,block->RO.hash2),height);
} else printf("iguana_hwmchain_set: mismatched ht.%d vs %d\n",block->height,height);
}
@ -1225,7 +1234,7 @@ struct iguana_bundle *iguana_bundleset(struct supernet_info *myinfo,struct iguan
prevhash2 = origblock->RO.prev_block;
if ( block != origblock )
{
iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,origblock);
iguana_blockcopy(0*coin->chain->zcash,coin->chain->auxpow,coin,block,origblock);
//fprintf(stderr,"bundleset block.%p vs origblock.%p prev.%d bits.%x fpos.%d\n",block,origblock,bits256_nonz(prevhash2),block->fpipbits,block->fpos);
}
*blockp = block;
@ -1376,7 +1385,7 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct supernet_info *myinfo,struc
if ( (bp= iguana_bundleset(myinfo,coin,&block,&bundlei,(struct iguana_block *)&zblocks[i])) == 0 )
{
bp = 0, bundlei = -2;
if ( (bp= iguana_bundleset(myinfo,coin,&block,&bundlei,(struct iguana_block *)&zblocks[i].RO.prev_block)) != 0 )
if ( (bp= iguana_bundlefind(coin,&bp,&bundlei,zblocks[i].RO.prev_block)) != 0 )
{
if ( bundlei < coin->chain->bundlesize-1 )
bundlei++;
@ -1451,7 +1460,7 @@ void iguana_autoextend(struct supernet_info *myinfo,struct iguana_info *coin,str
if ( time(NULL) > bp->hdrtime+3 && newbp->speculative == 0 )
{
bp->hdrtime = (uint32_t)time(NULL);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr));
}
//char str[65],str2[65]; printf("EXTEND last bundle %s/%s ht.%d\n",bits256_str(str,newbp->hashes[0]),bits256_str(str2,bp->nextbundlehash2),newbp->bundleheight);
if ( newbp->queued == 0 )
@ -1627,12 +1636,13 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig
{
struct iguana_bundle *bp=0,*prev; int32_t n,bundlei = -2; struct iguana_block *block,*next,*prevblock; char str[65]; bits256 hash2;
if ( (block= iguana_blockfind("recv",coin,origblock->RO.hash2)) != 0 )
iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock);
iguana_blockcopy(0*coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock);
else if ( (block= iguana_blockhashset("recvblock",coin,-1,origblock->RO.hash2,1)) == 0 )
{
printf("error adding %s\n",bits256_str(str,origblock->RO.hash2));
return(req);
}
else block->txvalid = block->valid = 1;
if ( bits256_nonz(origblock->RO.prev_block) != 0 )
{
if ( (prevblock= iguana_blockfind("prev",coin,origblock->RO.prev_block)) != 0 )
@ -1641,7 +1651,8 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig
coin->longestchain = prevblock->height+1;
} else iguana_blockQ("prev",coin,0,-1,origblock->RO.prev_block,1);
}
//printf("%s received.(%s) %s\n",coin->symbol,bits256_str(str,origblock->RO.hash2),addr->ipaddr);
if ( 0 && block != 0 )
printf("%s received.(%s) [%d:%d]\n",coin->symbol,bits256_str(str,origblock->RO.hash2),block->hdrsi,block->bundlei);
if ( (bp= iguana_bundleset(myinfo,coin,&block,&bundlei,(struct iguana_block *)origblock)) != 0 && bp == coin->current && block != 0 && bp->speculative != 0 && bundlei >= 0 )
{
if ( 0 && strcmp("BTCD",coin->symbol) == 0 )
@ -1678,7 +1689,7 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig
coin->numcached++;
if ( block != 0 )
block->queued = 1;
queue_enqueue("cacheQ",&coin->cacheQ,&req->DL,0);
queue_enqueue("cacheQ",&coin->cacheQ,&req->DL);
return(0);
}
else if ( block != 0 && block->req == 0 )
@ -1719,12 +1730,12 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig
{
printf("reissue hdrs request for [%d]\n",bp->hdrsi);
bp->hdrtime = (uint32_t)time(NULL);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])));
}
if ( (block= iguana_blockhashset("recvblock",coin,-1,origblock->RO.hash2,1)) != 0 )
{
if ( block != (struct iguana_block *)origblock )
iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock);
iguana_blockcopy(0*coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock);
if ( block->lag != 0 && block->issued != 0 )
block->lag = (uint32_t)time(NULL) - block->issued;
//printf("datalen.%d ipbits.%x\n",datalen,req->ipbits);
@ -1780,7 +1791,7 @@ int32_t iguana_reqblocks(struct supernet_info *myinfo,struct iguana_info *coin)
{
if ( (block= iguana_blockfind("hwmcheckb",coin,coin->blocks.hwmchain.RO.prev_block)) != 0 )
{
iguana_blockzcopy(coin->chain->zcash,(struct iguana_block *)&coin->blocks.hwmchain,block);
iguana_blockzcopy(0*coin->chain->zcash,(struct iguana_block *)&coin->blocks.hwmchain,block);
return(0);
}
}
@ -1929,7 +1940,7 @@ int32_t iguana_processrecvQ(struct supernet_info *myinfo,struct iguana_info *coi
{
int32_t flag = 0; struct iguana_bundlereq *req;
*newhwmp = 0;
while ( flag < IGUANA_MAXITERATIONS && coin->active != 0 && (req= queue_dequeue(&coin->recvQ,0)) != 0 )
while ( flag < IGUANA_MAXITERATIONS && coin->active != 0 && (req= queue_dequeue(&coin->recvQ)) != 0 )
{
if ( req->type != 'H' )
flag++;
@ -2004,18 +2015,18 @@ int32_t iguana_reqhdrs(struct iguana_info *coin)
if ( bp->issuetime == 0 )
coin->numpendings++;
init_hexbytes_noT(hashstr,bp->hashes[0].bytes,sizeof(bits256));
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr));
if ( bp == coin->current )
{
init_hexbytes_noT(hashstr,bp->hashes[0].bytes,sizeof(bits256));
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr));
//printf("%s issue HWM HDRS [%d] %s\n",coin->symbol,bp->hdrsi,hashstr);
if ( coin->blocks.hwmchain.height > 10 )
{
bits256 hash2 = iguana_blockhash(coin,coin->blocks.hwmchain.height-10);
init_hexbytes_noT(hashstr,hash2.bytes,sizeof(bits256));
//printf("%s issue HWM HDRS %d-10 %s\n",coin->symbol,coin->blocks.hwmchain.height,hashstr);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr));
}
}
//printf("hdrsi.%d reqHDR.(%s) numhashes.%d\n",bp->hdrsi,hashstr,bp->numhashes);
@ -2087,7 +2098,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle
if ( block->fpipbits == 0 && block->queued == 0 && block->req != 0 )
{
block->queued = 1;
queue_enqueue("cacheQ",&coin->cacheQ,&block->req->DL,0);
queue_enqueue("cacheQ",&coin->cacheQ,&block->req->DL);
block->req = 0;
//char str2[65]; printf("already have.(%s)\n",bits256_str(str2,block->RO.hash2));
}
@ -2124,7 +2135,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle
{
if ( 1 && n > 200000 )
printf("%s %s %s [%d:%d] %d %s %d numranked.%d qsize.%d\n",coin->symbol,argstr,str,bp!=0?bp->hdrsi:-1,bundlei,req->height,bits256_str(str2,hash2),coin->blocks.recvblocks,coin->peers != 0 ? coin->peers->numranked : -1,queue_size(Q));
while ( (ptr= queue_dequeue(Q,0)) != 0 )
while ( (ptr= queue_dequeue(Q)) != 0 )
myfree(ptr,sizeof(*ptr));
coin->backlog = n*10 + 1000000;
} else coin->backlog >>= 1;
@ -2133,7 +2144,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle
//block->numrequests++;
block->issued = now;
}
queue_enqueue(str,Q,&req->DL,0);
queue_enqueue(str,Q,&req->DL);
return(1);
} else printf("null Q\n");
} //else printf("queueblock skip priority.%d bundlei.%d\n",bundlei,priority);
@ -2144,7 +2155,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
{
uint8_t serialized[sizeof(struct iguana_msghdr) + sizeof(uint32_t)*32 + sizeof(bits256)];
struct iguana_block *block; struct iguana_blockreq *req=0; char *hashstr=0; bits256 hash2;
int32_t bundlei,priority,i,m,z,pend,limit,height=-1,datalen,flag = 0;
int32_t bundlei,priority,i,m,z,pend,limit,height=-1,datalen,flag = 0; struct stritem *hashitem;
uint32_t now; struct iguana_bundle *bp; struct iguana_peer *ptr;
if ( addr->msgcounts.verack == 0 )
return(0);
@ -2154,8 +2165,9 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
if ( iguana_needhdrs(coin) != 0 && addr->pendhdrs < IGUANA_MAXPENDHDRS )
{
//printf("%s check hdrsQ\n",addr->ipaddr);
if ( (hashstr= queue_dequeue(&coin->hdrsQ,1)) != 0 )
if ( (hashitem= queue_dequeue(&coin->hdrsQ)) != 0 )
{
hashstr = hashitem->str;
if ( (datalen= iguana_gethdrs(coin,serialized,coin->chain->gethdrsmsg,hashstr)) > 0 )
{
decode_hex(hash2.bytes,sizeof(hash2),hashstr);
@ -2187,8 +2199,9 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
//free_queueitem(hashstr);
//return(flag);
} else printf("datalen.%d from gethdrs\n",datalen);
free_queueitem(hashstr);
free(hashitem);
hashstr = 0;
hashitem = 0;
}
}
//if ( netBLOCKS > coin->MAXPEERS*coin->MAXPENDING )
@ -2204,7 +2217,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
}
priority = 1;
pend = 0;
req = queue_dequeue(&coin->priorityQ,0);
req = queue_dequeue(&coin->priorityQ);
if ( flag == 0 && req == 0 && addr->pendblocks < limit )
{
priority = 0;
@ -2217,7 +2230,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
}
}
if ( pend < coin->MAXPENDINGREQUESTS*m )
req = queue_dequeue(&coin->blocksQ,0);
req = queue_dequeue(&coin->blocksQ);
}
if ( req != 0 )
{
@ -2228,6 +2241,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
if ( bp->emitfinish != 0 )
{
//printf("skip emitting bundle [%d:%d]\n",bp->hdrsi,req->bundlei);
//free(req);
return(0);
}
block = bp->blocks[req->bundlei];
@ -2244,7 +2258,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
iguana_sendblockreqPT(coin,addr,bp,req->bundlei,hash2,0);
}
flag++;
myfree(req,sizeof(*req));
free(req);
}
return(flag);
}

6
iguana/iguana_secp.c

@ -37,7 +37,11 @@ int32_t bitcoin_pubkeylen(const uint8_t *pubkey)
return(33);
else if ( pubkey[0] == 4 )
return(65);
else return(-1);
else
{
printf("illegal pubkey.[%02x] %llx\n",pubkey[0],*(long long *)pubkey);
return(-1);
}
}
bits256 bitcoin_randkey(secp256k1_context *ctx)

62
iguana/iguana_spendvectors.c

@ -266,6 +266,7 @@ int32_t iguana_spendvectors(struct supernet_info *myinfo,struct iguana_info *coi
//printf("iguana_spendvectors.[%d]: already have Xspendinds[%d]\n",bp->hdrsi,ramchain->numXspends);
return(0);
}
bp->startutxo = (uint32_t)time(NULL);
ptr = mycalloc('x',sizeof(*ptr),n);
total += n;
startmillis = OS_milliseconds();
@ -474,6 +475,9 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig
if ( (Xspendinds= bp->tmpspends) == 0 )
{
//printf("iguana_balancegen.%d: no Xspendinds[%d]\n",bp->hdrsi,numXspends);
numXspends = iguana_Xspendmap(coin,ramchain,bp);
numXspends = ramchain->numXspends;
//printf("Xspendinds.%p[%d]\n",Xspendinds,numXspends);
//return(-1);
}
}
@ -571,7 +575,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig
else //if ( Xspendinds != 0 )
{
errs++;
printf("iguana_balancegen: spendind.%u external.%d error spentbp.%p with unspentind.%d pkind.%u [%d] (%d %d %d)\n",spendind,s->external,spentbp,spent_unspentind,spent_pkind,spent_hdrsi,i,j,k);
printf("iguana_balancegen: X%p[%d] spendind.%u external.%d error spentbp.%p with unspentind.%d pkind.%u [%d] (%d %d %d)\n",Xspendinds,numXspends,spendind,s->external,spentbp,spent_unspentind,spent_pkind,spent_hdrsi,i,j,k);
}
}
}
@ -772,7 +776,7 @@ void iguana_initfinal(struct supernet_info *myinfo,struct iguana_info *coin,bits
if ( bits256_nonz(lastbundle) > 0 )
{
init_hexbytes_noT(hashstr,lastbundle.bytes,sizeof(bits256));
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr));
}
for (i=0; i<coin->bundlescount-1; i++)
{
@ -1004,7 +1008,7 @@ int32_t iguana_spendvectorsaves(struct iguana_info *coin)
return(0);
coin->spendvectorsaved = 1;
n = coin->bundlescount - 1;
//printf("SAVE SPEND VECTORS %d of %d\n",n,coin->bundlescount);
printf("SAVE SPEND VECTORS %d of %d\n",n,coin->bundlescount);
for (iter=0; iter<2; iter++)
{
for (i=0; i<n; i++)
@ -1129,9 +1133,12 @@ int32_t iguana_bundlevalidate(struct supernet_info *myinfo,struct iguana_info *c
int32_t i,max,len,errs = 0; struct sha256_vstate vstate; bits256 validatehash; int64_t total = 0;
if ( coin->chain->zcash != 0 )
{
printf("need to process joinsplits before can validate.%s\n",coin->symbol);
static uint32_t counter;
if ( counter++ < 3 )
printf("need to process joinsplits before can validate.%s\n",coin->symbol);
bp->validated = (uint32_t)time(NULL);
return(bp->n);
forceflag = 1;
//return(bp->n);
}
if ( (coin->MAXPEERS > 1 && coin->VALIDATENODE == 0 && coin->FULLNODE == 0) || bp->ramchain.from_ro != 0 )//|| bp == coin->current )
{
@ -1158,31 +1165,34 @@ int32_t iguana_bundlevalidate(struct supernet_info *myinfo,struct iguana_info *c
}
if ( forceflag != 0 || bp->validated <= 1 )
{
max = coin->blockspacesize;
blockspace = calloc(1,max);
iguana_volatilespurge(coin,&bp->ramchain);
iguana_volatilesmap(myinfo,coin,&bp->ramchain);
for (i=0; i<bp->n; i++)
if ( coin->chain->zcash == 0 )
{
char str[65];
if ( coin->chain->fixit != 0 )
printf("validate %s.[%d:%d] %s\n",coin->symbol,bp->hdrsi,i,bits256_str(str,bp->hashes[i]));
if ( (len= iguana_peerblockrequest(myinfo,coin,blockspace,max,0,bp->hashes[i],1)) < 0 )
{
errs++;
//fprintf(stderr,"-%s.[%d:%d] ",coin->symbol,bp->hdrsi,i);
//printf("bundlevalidate: %s delete [%d:%d]\n",coin->symbol,bp->hdrsi,i);
iguana_blockunmark(coin,bp->blocks[i],bp,i,1);
totalerrs++;
}
else
max = coin->blockspacesize;
blockspace = calloc(1,max);
iguana_volatilespurge(coin,&bp->ramchain);
iguana_volatilesmap(myinfo,coin,&bp->ramchain);
for (i=0; i<bp->n; i++)
{
vupdate_sha256(validatehash.bytes,&vstate,bp->hashes[i].bytes,sizeof(bp->hashes[i]));
total += len, totalvalidated++;
char str[65];
if ( coin->chain->fixit != 0 )
printf("validate %s.[%d:%d] %s\n",coin->symbol,bp->hdrsi,i,bits256_str(str,bp->hashes[i]));
if ( (len= iguana_peerblockrequest(myinfo,coin,blockspace,max,0,bp->hashes[i],1)) < 0 )
{
errs++;
//fprintf(stderr,"-%s.[%d:%d] ",coin->symbol,bp->hdrsi,i);
//printf("bundlevalidate: %s delete [%d:%d]\n",coin->symbol,bp->hdrsi,i);
iguana_blockunmark(coin,bp->blocks[i],bp,i,1);
totalerrs++;
}
else
{
vupdate_sha256(validatehash.bytes,&vstate,bp->hashes[i].bytes,sizeof(bp->hashes[i]));
total += len, totalvalidated++;
}
}
free(blockspace);
printf("%s %s VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d %llx\n",coin->symbol,errs!=0?"NOT":"",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated,(long long)validatehash.txid);
}
free(blockspace);
printf("%s %s VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d %llx\n",coin->symbol,errs!=0?"NOT":"",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated,(long long)validatehash.txid);
if ( errs == 0 )
bp->validated = (uint32_t)time(NULL);
else bp->validated = bp->startutxo = bp->utxofinish = 0;

8
iguana/iguana_wallet.c

@ -1359,6 +1359,10 @@ THREE_STRINGS(bitcoinrpc,encryptwallet,passphrase,password,permanentfile)
password = passphrase;
if ( passphrase == 0 || passphrase[0] == 0 )
passphrase = password;
if ( passphrase == 0 )
passphrase = "";
if ( password == 0 )
password = "";
strcpy(myinfo->secret,passphrase);
strcpy(myinfo->password,password);
if ( permanentfile != 0 )
@ -1801,8 +1805,8 @@ THREE_INTS(bitcoinrpc,listreceivedbyaddress,minconf,includeempty,flag)
cJSON *retjson,*item,*array,*txids,*vouts; struct iguana_waccount *wacct,*tmp; struct iguana_waddress *waddr,*tmp2; uint8_t addrtype; char coinaddr[64];
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
if ( myinfo->expiration == 0 )
return(clonestr("{\"error\":\"need to unlock wallet\"}"));
//if ( myinfo->expiration == 0 )
// return(clonestr("{\"error\":\"need to unlock wallet\"}"));
array = cJSON_CreateArray();
HASH_ITER(hh,myinfo->wallet,wacct,tmp)
{

1
iguana/m_LP

@ -1,3 +1,4 @@
#!/bin/bash
#./configure --enable-endomorphism --enable-module-ecdh --enable-module-schnorr --enable-module-rangeproof --enable-experimental --enable-module_recovery
rm -f ../agents/iguana *.o
git pull

1
iguana/m_clean

@ -1 +1,2 @@
#!/bin/bash
rm *.o ../agents/iguana

1
iguana/m_js

@ -1,3 +1,4 @@
#!/bin/bash
rm ../agents/iguana *.o
git pull
emcc -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o iguana.html -O3 -I. -Isecp256k1./src -Isecp256k1/include -Isecp256k1/src -Wno-unused-parameter -Wnested-externs -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings -fvisibility=hidden -DHAVE_CONFIG_H *.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c secp256k1/src/secp256k1.c -lm

42
iguana/m_notary

@ -1,3 +1,4 @@
#!/bin/bash
pkill iguana
rm -f ../agents/iguana *.o
git pull
@ -10,6 +11,7 @@ gcc -g -o ../agents/iguana *.o ../agents/libcrypto777.a -lnanomsg -lcurl -lssl -
../agents/iguana notary & #> iguana.log 2> error.log &
myip=`curl -s4 checkip.amazonaws.com`
source pubkey.txt
sleep 4
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\"myipaddr\",\"ipaddr\":\"$myip\"}"
@ -18,7 +20,41 @@ tests/addnotarys_7776
./btc_7776
./kmd_7776
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}"
./dpow_7776
sleep 3
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}"
sleep 7
./wp_7776
sleep 3
curl --url "http://127.0.0.1:7776" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"USD\",\"pubkey\":\"$pubkey\"}"
sleep 6
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"EUR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"JPY\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"GBP\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"AUD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CAD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CHF\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NZD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CNY\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RUB\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MXN\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BRL\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"INR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HKD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"TRY\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ZAR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PLN\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NOK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SEK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"DKK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CZK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HUF\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ILS\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KRW\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MYR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PHP\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RON\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SGD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"THB\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BGN\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"IDR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HRK\",\"pubkey\":\"$pubkey\"}"

1
iguana/m_osx

@ -1,3 +1,4 @@
#!/bin/bash
#./configure --enable-endomorphism --enable-module-ecdh --enable-module-schnorr --enable-module-rangeproof --enable-experimental --enable-module_recovery
rm ../agents/iguana *.o
git pull

1
iguana/m_pnacl

@ -1 +1,2 @@
#!/bin/bash
make

1
iguana/m_win32

@ -1,2 +1,3 @@
#!/bin/bash
make -f mingw32

1
iguana/m_win64

@ -1 +1,2 @@
#!/bin/bash
make -f mingw64

12
iguana/main.c

@ -190,10 +190,10 @@ int32_t iguana_jsonQ(struct supernet_info *myinfo,struct iguana_info *coin)
if ( (ptr->retjsonstr= SuperNET_jsonstr(ptr->myinfo,ptr->jsonstr,ptr->remoteaddr,ptr->port)) == 0 )
ptr->retjsonstr = clonestr("{\"error\":\"null return from iguana_jsonstr\"}");
printf("COMMANDLINE_ARGFILE.(%s) -> (%s) %.0f\n",ptr->jsonstr,ptr->retjsonstr!=0?ptr->retjsonstr:"null return",OS_milliseconds());
queue_enqueue("finishedQ",finishedQ,&ptr->DL,0);
queue_enqueue("finishedQ",finishedQ,&ptr->DL);
return(1);
}
if ( (ptr= queue_dequeue(finishedQ,0)) != 0 )
if ( (ptr= queue_dequeue(finishedQ)) != 0 )
{
if ( ptr->expired != 0 )
{
@ -204,14 +204,14 @@ int32_t iguana_jsonQ(struct supernet_info *myinfo,struct iguana_info *coin)
}
printf("garbage collection: expired.(%s)\n",ptr->jsonstr);
myfree(ptr,ptr->allocsize);
} else queue_enqueue("finishedQ",finishedQ,&ptr->DL,0);
} else queue_enqueue("finishedQ",finishedQ,&ptr->DL);
}
if ( (ptr= queue_dequeue(jsonQ,0)) != 0 )
if ( (ptr= queue_dequeue(jsonQ)) != 0 )
{
if ( (ptr->retjsonstr= SuperNET_jsonstr(ptr->myinfo,ptr->jsonstr,ptr->remoteaddr,ptr->port)) == 0 )
ptr->retjsonstr = clonestr("{\"error\":\"null return from iguana_jsonstr\"}");
//printf("finished.(%s) -> (%s) %.0f\n",ptr->jsonstr,ptr->retjsonstr!=0?ptr->retjsonstr:"null return",OS_milliseconds());
queue_enqueue("finishedQ",finishedQ,&ptr->DL,0);
queue_enqueue("finishedQ",finishedQ,&ptr->DL);
return(1);
}
return(0);
@ -234,7 +234,7 @@ char *iguana_blockingjsonstr(struct supernet_info *myinfo,struct iguana_info *co
if ( coin == 0 || coin->FULLNODE < 0 || (coin->FULLNODE == 0 && coin->VALIDATENODE == 0) )
Q = &JSON_Q;
else Q = &coin->jsonQ;
queue_enqueue("jsonQ",Q,&ptr->DL,0);
queue_enqueue("jsonQ",Q,&ptr->DL);
while ( OS_milliseconds() < expiration )
{
usleep(100);

3
iguana/notaries.h

@ -28,6 +28,7 @@ char *Notaries[][2] =
{ "movecrypto_EU", "021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" },
{ "badass_EU", "0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" },
{ "crackers_NA", "029e1c01131974f4cd3f564cc0c00eb87a0f9721043fbc1ca60f9bd0a1f73f64a1" },
{ "proto_EU", "03681ffdf17c8f4f0008cefb7fa0779c5e888339cdf932f0974483787a4d6747c1" },
{ "jeezy_EU", "023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" },
{ "farl4web_EU", "035caa40684ace968677dca3f09098aa02b70e533da32390a7654c626e0cf908e1" },
@ -38,6 +39,7 @@ char *Notaries[][2] =
{ "supernet_AE", "029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355" },
{ "supernet_EU", "02061c6278b91fd4ac5cab4401100ffa3b2d5a277e8f71db23401cc071b3665546" },
{ "supernet_NA", "033c073366152b6b01535e15dd966a3a8039169584d06e27d92a69889b720d44e1" },
{ "yassin_EU", "033fb7231bb66484081952890d9a03f91164fb27d392d9152ec41336b71b15fbd0" },
{ "durerus_EU", "02bcbd287670bdca2c31e5d50130adb5dea1b53198f18abeec7211825f47485d57" },
{ "badass_SH", "026b49dd3923b78a592c1b475f208e23698d3f085c4c3b4906a59faf659fd9530b" },
@ -48,6 +50,7 @@ char *Notaries[][2] =
{ "grewal_SH", "03212a73f5d38a675ee3cdc6e82542a96c38c3d1c79d25a1ed2e42fcf6a8be4e68" },
{ "polycryptoblock_NA", "02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622" },
{ "titomane_NA", "0387046d9745414fb58a0fa3599078af5073e10347e4657ef7259a99cb4f10ad47" },
{ "titomane_AE", "03cda6ca5c2d02db201488a54a548dbfc10533bdc275d5ea11928e8d6ab33c2185" },
{ "kolo_EU", "03f5c08dadffa0ffcafb8dd7ffc38c22887bd02702a6c9ac3440deddcf2837692b" },
{ "artik_NA", "0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842" },

10
iguana/pangea_hand.c

@ -24,11 +24,11 @@ struct pangea_queueitem *pangea_queuefind(struct table_info *tp,int32_t waiteven
int32_t iter; struct pangea_queueitem *ptr;
for (iter=0; iter<2; iter++)
{
while ( (ptr= queue_dequeue(&tp->stateQ[iter],0)) != 0 )
while ( (ptr= queue_dequeue(&tp->stateQ[iter])) != 0 )
{
if ( ptr->waitevent == waitevent )
return(ptr);
queue_enqueue("stateQ",&tp->stateQ[iter ^ 1],&ptr->DL,0);
queue_enqueue("stateQ",&tp->stateQ[iter ^ 1],&ptr->DL);
}
}
return(0);
@ -42,7 +42,7 @@ void pangea_queuestate(struct table_info *tp,int32_t currentstate,int32_t waitev
ptr->last = ptr->start = tai_now();
ptr->waitevent = waitevent;
char str[65]; printf("table.%s current.%d -> wait.%d\n",bits256_str(str,tp->G.tablehash),currentstate,waitevent);
queue_enqueue("stateQ",&tp->stateQ[0],&ptr->DL,0);
queue_enqueue("stateQ",&tp->stateQ[0],&ptr->DL);
}
int32_t pangea_slotA(struct table_info *tp) { return(0); }
@ -383,7 +383,7 @@ int32_t pangea_queueprocess(struct supernet_info *myinfo,struct table_info *tp)
//char str[65]; printf("queueprocess.(%s)\n",bits256_str(str,tp->G.tablehash));
for (iter=0; iter<2; iter++)
{
while ( (ptr= queue_dequeue(&tp->stateQ[iter],0)) != 0 )
while ( (ptr= queue_dequeue(&tp->stateQ[iter])) != 0 )
{
retval = 0;
diff = tai_diff(ptr->last,tai_now());
@ -409,7 +409,7 @@ int32_t pangea_queueprocess(struct supernet_info *myinfo,struct table_info *tp)
else
{
ptr->last = tai_now();
queue_enqueue("stateQ",&tp->stateQ[iter ^ 1],&ptr->DL,0);
queue_enqueue("stateQ",&tp->stateQ[iter ^ 1],&ptr->DL);
}
}
}

1
iguana/tests/DEX

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"genesis_opreturn\",\"vals\":{\"issuer\":\"RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA\",\"stake\":1000000,\"blocktime\":1,\"name\":\"InstantDEX\",\"symbol\":\"DEX\",\"p2sh\":5,\"wif\":128,\"nBits\":\"1effffff\"}}"

1
iguana/tests/DEXtx

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"sendtoaddress\",\"params\":[\"RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA\", 0.0001, \"4e4557444558000000496e7374616e74444558000000000000407a10f35a0000dffc6993a2216d57ffffff1e1f4e010001000cba013c0580f1dce4182fce875748c4986b240ff7d7bc3fffb0\", \"sendcomment\"]}"

1
iguana/tests/HOT

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"genesis_opreturn\",\"vals\":{\"issuer\":\"RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA\",\"stake\":1000000,\"blocktime\":1,\"name\":\"HOT ICO\",\"symbol\":\"HOT\",\"p2sh\":5,\"wif\":128,\"nBits\":\"1effffff\"}}"

1
iguana/tests/HOTtx

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"sendtoaddress\",\"params\":[\"RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA\", 0.0001, \"4e4557484f54000000484f542049434f000000000000000000407a10f35a00007f53009145d46b57ffffff1e0000000001009577013c0580f1dce4182fce875748c4986b240ff7d7bc3fffb0\", \"sendcomment\"]}"

1
iguana/tests/LPinit

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"liquidity\",\"targetcoin\":\"BTCD\",\"vals\":{\"profit\":0.01}}"

1
iguana/tests/PAX

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"pax\",\"method\":\"start\"}"

1
iguana/tests/PoS

@ -1,3 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"PoSweights\",\"activecoin\":\"BTCD\",\"height\":1192000}"
curl --url "http://127.0.0.1:7778" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"PoSweights\",\"activecoin\":\"BTCD\",\"height\":1192500}"
curl --url "http://127.0.0.1:7778" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"PoSweights\",\"activecoin\":\"BTCD\",\"height\":1193000}"

1
iguana/tests/accept

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"accept\",\"requestid\":1728286611,\"quoteid\":123456}"

1
iguana/tests/activehandle

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"activehandle\"}"

1
iguana/tests/addmultisig

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"method\":\"addmultisig\",\"params\":[2, [\"1CHzgAakwGCvGX2BG1duWygDuVE6s7tzZ6\", \"d0296ed1364639c696c374730320480301f3194c86231f62f0409cd76467f87c\", \"d045925b3e6f648bca6ed0c65149ee445137f0ab14e88cf60013d88419bcdd60\"], \"msigs\"]}"

1
iguana/tests/addnode

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"BTC\",\"ipaddr\":\"5.9.102.210\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"BTC\",\"ipaddr\":\"78.47.196.146\"}"

1
iguana/tests/addnode2

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"BTC\",\"ipaddr\":\"5.9.102.210\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"BTC\",\"ipaddr\":\"78.47.196.146\"}"

1
iguana/tests/addnodeSYS

@ -1,2 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"SYS\",\"ipaddr\":\"198.147.29.138\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"SYS\",\"ipaddr\":\"118.244.207.7\"}"

1
iguana/tests/addnotarys

@ -1,3 +1,4 @@
#!/bin/bash
../coins/notary
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"5.9.102.210\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"78.47.196.146\"}"

1
iguana/tests/addnotarys_7776

@ -1,3 +1,4 @@
#!/bin/bash
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"5.9.102.210\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"78.47.196.146\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"149.56.29.163\"}"

1
iguana/tests/ahloop

@ -1,3 +1,4 @@
#!/bin/bash
ind=0
one=1
while true

1
iguana/tests/allcoins

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"allcoins\"}"

1
iguana/tests/amlp

@ -1 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"amlp\"}"

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save