Browse Source

Merge pull request #253 from jl777/dev

Dev
win-cross
jl777 8 years ago
committed by GitHub
parent
commit
d989bafbbc
  1. 30
      .gitignore
  2. 113
      basilisk/basilisk.c
  3. 2
      basilisk/basilisk_DEX.c
  4. 2
      basilisk/basilisk_MSG.c
  5. 100
      basilisk/basilisk_bitcoin.c
  6. 2
      basilisk/basilisk_ping.c
  7. 4
      basilisk/basilisk_swap.c
  8. 1
      basilisk/basilisk_tradebot.c
  9. 10
      basilisk/tradebots_SVM.h
  10. 6
      basilisk/tradebots_liquidity.c
  11. 2
      crypto777/OS_portable.c
  12. 7
      crypto777/OS_time.c
  13. 3
      crypto777/SaM.c
  14. 10
      crypto777/bitcoind_RPC.c
  15. 2
      crypto777/iguana_OS.c
  16. 8
      crypto777/iguana_utils.c
  17. 4
      crypto777/inet.c
  18. 2
      crypto777/ramcoder.c
  19. 23
      datachain/datachain.c
  20. 4
      gecko/gecko.c
  21. 2
      gecko/gecko_headers.c
  22. 2
      gecko/gecko_miner.c
  23. 4
      iguana/SuperNET_keys.c
  24. 2
      iguana/cards777.c
  25. 1
      iguana/dpow/dpow_fsm.c
  26. 14
      iguana/dpow/dpow_network.c
  27. 2
      iguana/dpow/dpow_prices.c
  28. 2
      iguana/dpow/dpow_tx.c
  29. 52
      iguana/dpowassets
  30. 1
      iguana/exchanges/bitcoin.c
  31. 3
      iguana/exchanges/fxcm.c
  32. 8
      iguana/iguana777.c
  33. 2
      iguana/iguana777.h
  34. 4
      iguana/iguana_accept.c
  35. 8
      iguana/iguana_bitmap.c
  36. 8
      iguana/iguana_blocks.c
  37. 37
      iguana/iguana_bundles.c
  38. 8
      iguana/iguana_chains.c
  39. 2
      iguana/iguana_exchanges.c
  40. 4
      iguana/iguana_init.c
  41. 7
      iguana/iguana_interpreter.c
  42. 4
      iguana/iguana_json.c
  43. 7
      iguana/iguana_mofn.c
  44. 16
      iguana/iguana_msg.c
  45. 3
      iguana/iguana_notary.c
  46. 81
      iguana/iguana_payments.c
  47. 12
      iguana/iguana_peers.c
  48. 61
      iguana/iguana_ramchain.c
  49. 10
      iguana/iguana_realtime.c
  50. 62
      iguana/iguana_recv.c
  51. 2
      iguana/iguana_rpc.c
  52. 11
      iguana/iguana_scripts.c
  53. 6
      iguana/iguana_secp.c
  54. 26
      iguana/iguana_sign.c
  55. 26
      iguana/iguana_spendvectors.c
  56. 4
      iguana/iguana_tx.c
  57. 22
      iguana/iguana_txidfind.c
  58. 28
      iguana/iguana_unspents.c
  59. 2
      iguana/iguana_volatiles.c
  60. 4
      iguana/iguana_wallet.c
  61. 6
      iguana/kmd_lookup.h
  62. 18
      iguana/main.c
  63. 1
      iguana/mini-gmp.c
  64. 2
      iguana/pangea_api.c
  65. 2
      iguana/pangea_hand.c
  66. 22
      iguana/pangea_json.c
  67. 2
      iguana/ramchain_api.c
  68. 2
      iguana/secp256k1/src/ecmult_const_impl.h
  69. 2
      iguana/secp256k1/src/modules/rangeproof/rangeproof_impl.h
  70. 2
      iguana/secp256k1/src/modules/recovery/main_impl.h
  71. 253
      iguana/tests/KMD.batch9
  72. 251
      iguana/tests/KMD.batch9.importaddress
  73. 200
      iguana/tests/KMD.batch9.listunspent
  74. 27
      iguana/tests/REVS.batch9
  75. 18
      iguana/tests/REVS.batch9.importaddress
  76. 2
      iguana/tests/dexgetO
  77. 2
      iguana/tests/refresh
  78. 2
      iguana/tests/utxorawtx
  79. 2
      includes/iguana_apideclares.h
  80. 2
      includes/iguana_funcs.h
  81. 10
      includes/iguana_structs.h

30
.gitignore

@ -37,3 +37,33 @@ iguana/confs/BTC_hdrs.txt
deprecated/.DS_Store
.DS_Store
*.pbxproj
iguana/tmp/.tmpmarker
iguana/SVM/rawfeatures/.tmpmarker
iguana/DB/.tmpmarker
iguana/DB/TRANSACTIONS/.tmpmarker
iguana/DB/purgeable/.tmpmarker
iguana/DB/purgeable/BTCD/.tmpmarker
iguana/DB/purgeable/BTC/.tmpmarker
iguana/DB/ECB/.tmpmarker
iguana/genesis/.tmpmarker
iguana/help/.tmpmarker
iguana/SVM/.tmpmarker
iguana/SVM/models/.tmpmarker
SuperNET.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist
SuperNET.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/SuperNET.xcscheme

113
basilisk/basilisk.c

@ -265,6 +265,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
}
if ( s == n && valid == 1 && (destipaddr == 0 || strcmp(addr->ipaddr,destipaddr) == 0) )
{
val = 0;
//fprintf(stderr,">>> (%s).%u ",addr->ipaddr,coin->chain->portp2p);
//printf("n.%d/fanout.%d i.%d l.%d [%s].tag%u send %s [%x] datalen.%d addr->supernet.%u basilisk.%u to (%s).%d destip.%s\n",n,fanout,i,l,cmd,*(uint32_t *)data,type,*(int32_t *)&data[datalen-4],datalen,addr->supernet,addr->basilisk,addr->ipaddr,addr->A.port,destipaddr!=0?destipaddr:"broadcast");
if ( encryptflag != 0 && bits256_nonz(addr->pubkey) != 0 )
@ -462,7 +463,7 @@ char *basilisk_standardservice(char *CMD,struct supernet_info *myinfo,void *_add
}
ptr->finished = OS_milliseconds() + 10000;
}
if ( 0 && strcmp("MSG",CMD) == 0 )
if ( (0) && strcmp("MSG",CMD) == 0 )
printf("%s.(%s) -> (%s)\n",CMD,jprint(valsobj,0),retstr!=0?retstr:"");
return(retstr);
}
@ -793,10 +794,10 @@ int32_t basilisk_p2pQ_process(struct supernet_info *myinfo,int32_t maxiters)
else
{
len += iguana_rwnum(0,ptr->data,sizeof(basilisktag),&basilisktag);
if ( 0 && myinfo->IAMLP == 0 )
if ( (0) && myinfo->IAMLP == 0 )
printf("RELAYID.%d ->received.%d basilisk_p2p.(%s) from %s tag.%u\n",myinfo->NOTARY.RELAYID,ptr->datalen,ptr->type,senderip,basilisktag);
basilisk_msgprocess(myinfo,ptr->addr,ptr->ipbits,ptr->type,basilisktag,&ptr->data[len],ptr->datalen - len);
if ( 0 && myinfo->IAMLP == 0 )
if ( (0) && myinfo->IAMLP == 0 )
printf("processed.%s from %s\n",ptr->type,senderip);
}
free(ptr);
@ -1069,4 +1070,110 @@ INT_ARG(iguana,paxfiats,mask)
komodo_assetcoins(1,mask);
return(clonestr("{\"result\":\"success\"}"));
}
int32_t utxocmp(cJSON *utxo,cJSON *utxo2)
{
bits256 txid,txid2; int32_t vout=-1,vout2=-1;
//printf("cmp (%s) vs (%s)\n",jprint(utxo,0),jprint(utxo2,0));
txid = jbits256(utxo,"txid");
vout = jint(utxo,"vout");
txid2 = jbits256(utxo2,"txid");
vout2 = jint(utxo2,"vout");
if ( bits256_cmp(txid,txid2) == 0 && vout == vout2 )
return(0);
else return(-1);
}
TWO_STRINGS(basilisk,refresh,symbol,address)
{
cJSON *array=0,*array2=0,*array3,*item,*item2; char *retstr; int32_t i,j,n,m,vout; bits256 txid;
if ( symbol != 0 && iguana_isnotarychain(symbol) >= 0 && address != 0 && address[0] != 0 )
{
if ( (retstr= _dex_listunspent(myinfo,symbol,address)) != 0 )
{
array = cJSON_Parse(retstr);
free(retstr);
}
if ( (retstr= _dex_listunspent2(myinfo,symbol,address)) != 0 )
{
if ( array == 0 )
array = cJSON_Parse(retstr);
else array2 = cJSON_Parse(retstr);
free(retstr);
}
if ( array != 0 && array2 != 0 ) // merge
{
m = cJSON_GetArraySize(array2);
array3 = jduplicate(array);
n = cJSON_GetArraySize(array3);
//printf("MERGE %s and %s\n",jprint(array,0),jprint(array2,0));
for (j=0; j<m; j++)
{
item2 = jitem(array2,j);
for (i=0; i<n; i++)
if ( utxocmp(jitem(array,i),item2) == 0 )
break;
if ( i == n )
{
//printf("FOUND NEW %s\n",jprint(item2,0));
jaddi(array3,jduplicate(item2));
}
}
free_json(array);
free_json(array2), array2 = 0;
array = array3, array3 = 0;
}
if ( array != 0 ) // gettxout
{
n = cJSON_GetArraySize(array);
array3 = cJSON_CreateArray();
for (i=0; i<n; i++)
{
item = jitem(array,i);
txid = jbits256(item,"txid");
vout = jint(item,"vout");
if ( (retstr= _dex_gettxout(myinfo,symbol,txid,vout)) != 0 )
{
if ( (item2= cJSON_Parse(retstr)) != 0 )
{
if ( jdouble(item2,"value") > 0 )
{
jaddbits256(item2,"txid",txid);
jaddnum(item2,"vout",vout);
jaddnum(item2,"amount",jdouble(item2,"value"));
//printf("%s\n",jprint(item2,0));
jaddi(array3,item2);
}
else free_json(item2);
}
free(retstr);
}
}
free_json(array);
return(jprint(array3,1));
} else return(clonestr("[]"));
}
return(clonestr("{\"error\":\"invalid coin or address specified\"}"));
}
STRING_ARRAY_OBJ_STRING(basilisk,utxorawtx,symbol,utxos,vals,ignore)
{
char *destaddr,*changeaddr; uint64_t satoshis,txfee; int32_t completed,sendflag,timelock;
timelock = jint(vals,"timelock");
sendflag = jint(vals,"sendflag");
satoshis = jdouble(vals,"amount") * SATOSHIDEN;
destaddr = jstr(vals,"destaddr");
changeaddr = jstr(vals,"changeaddr");
if ( destaddr != 0 && changeaddr != 0 && symbol != 0 && (coin= iguana_coinfind(symbol)) != 0 )
{
if ( (txfee= jdouble(vals,"txfee") * SATOSHIDEN) == 0 )
txfee = coin->txfee;
return(iguana_utxorawtx(myinfo,coin,timelock,destaddr,changeaddr,satoshis,txfee,&completed,sendflag,utxos));
}
return(clonestr("{\"error\":\"invalid coin or address specified\"}"));
}
//int64_t iguana_verifytimelock(struct supernet_info *myinfo,struct iguana_info *coin,uint32_t timelocked,char *destaddr,bits256 txid,int32_t vout)
#include "../includes/iguana_apiundefs.h"

2
basilisk/basilisk_DEX.c

@ -681,7 +681,7 @@ HASH_ARRAY_STRING(InstantDEX,request,hash,vals,hexstr)
} else printf("error creating request\n");
if ( datalen > 0 )
{
uint32_t msgid,crc,crcs[2],numiters = 0; uint8_t buf[4096];
uint32_t msgid,crc=0,crcs[2],numiters = 0; uint8_t buf[4096];
memset(hash.bytes,0,sizeof(hash));
msgid = (uint32_t)time(NULL);
DEX_channel = 'D' + ((uint32_t)'E' << 8) + ((uint32_t)'X' << 16);

2
basilisk/basilisk_MSG.c

@ -538,7 +538,7 @@ uint32_t basilisk_crcrecv(struct supernet_info *myinfo,int32_t width,uint8_t *ve
uint32_t basilisk_crcsend(struct supernet_info *myinfo,int32_t width,uint8_t *verifybuf,int32_t maxlen,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen,uint32_t crcs[2])
{
uint32_t crc; int32_t recvlen;
uint32_t crc; int32_t recvlen=0;
if ( crcs != 0 )
{
crc = calc_crc32(0,data,datalen);

100
basilisk/basilisk_bitcoin.c

@ -580,6 +580,106 @@ char *iguana_utxoduplicates(struct supernet_info *myinfo,struct iguana_info *coi
return(rawtx);
}
int64_t iguana_verifytimelock(struct supernet_info *myinfo,struct iguana_info *coin,uint32_t timelocked,char *destaddr,bits256 txid,int32_t vout)
{
uint8_t script[35],script2[35],p2shscript[128],rmd160[20],addrtype; char *retstr,*spendscriptstr; int32_t p2shlen,spendlen; cJSON *sobj,*txout=0; int64_t value = 0;
bitcoin_addr2rmd160(&addrtype,rmd160,destaddr);
if ( addrtype != coin->chain->pubtype )
return(-1);
p2shlen = bitcoin_timelockspend(p2shscript,0,rmd160,timelocked);
calc_rmd160(0,rmd160,p2shscript,p2shlen);
spendlen = bitcoin_p2shspend(script,0,rmd160);
if ( coin->FULLNODE != 0 )
txout = dpow_gettxout(myinfo,coin,txid,vout);
else if ( (retstr= _dex_gettxout(myinfo,coin->symbol,txid,vout)) != 0 )
{
txout = cJSON_Parse(retstr);
free(retstr);
}
if ( txout != 0 )
{
if ( (sobj= jobj(txout,"scriptPubKey")) != 0 && (spendscriptstr= jstr(sobj,"hex")) == 0 )
{
if ( strlen(spendscriptstr) == spendlen*2 )
{
decode_hex(script2,spendlen,spendscriptstr);
if ( memcmp(script,script2,spendlen) != 0 )
return(-2);
value = SATOSHIDEN * jdouble(txout,"value");
} else return(-4);
}
free_json(txout);
return(value);
} return(-2);
}
char *iguana_utxorawtx(struct supernet_info *myinfo,struct iguana_info *coin,int32_t timelock,char *destaddr,char *changeaddr,uint64_t satoshis,uint64_t txfee,int32_t *completedp,int32_t sendflag,cJSON *utxos)
{
uint8_t script[35],p2shscript[128],rmd160[20],addrtype; bits256 txid; int32_t p2shlen,spendlen; cJSON *retjson,*txobj=0,*vins=0; char *rawtx=0,*signedtx=0; uint32_t timelocked = 0;
*completedp = 0;
if ( iguana_addressvalidate(coin,&addrtype,destaddr) < 0 || iguana_addressvalidate(coin,&addrtype,changeaddr) < 0 )
return(clonestr("{\"error\":\"invalid coin address\"}"));
bitcoin_addr2rmd160(&addrtype,rmd160,changeaddr);
if ( addrtype != coin->chain->pubtype )
return(clonestr("{\"error\":\"invalid changeaddr type\"}"));
bitcoin_addr2rmd160(&addrtype,rmd160,destaddr);
if ( addrtype != coin->chain->pubtype )
return(clonestr("{\"error\":\"invalid dest address type\"}"));
retjson = cJSON_CreateObject();
if ( (txobj= bitcoin_txcreate(coin->symbol,coin->chain->isPoS,0,1,0)) != 0 )
{
if ( timelock == 0 )
spendlen = bitcoin_standardspend(script,0,rmd160);
else
{
timelocked = (uint32_t)(time(NULL)+timelock);
if ( (timelocked % 3600) != 0 )
timelocked += (3600 - (timelocked % 3600));
p2shlen = bitcoin_timelockspend(p2shscript,0,rmd160,timelocked);
calc_rmd160(0,rmd160,p2shscript,p2shlen);
spendlen = bitcoin_p2shspend(script,0,rmd160);
printf("timelock.%d spend timelocked %u\n",timelock,timelocked);
}
bitcoin_txoutput(txobj,script,spendlen,satoshis);
if ( (rawtx= iguana_calcutxorawtx(myinfo,coin,&vins,txobj,satoshis,changeaddr,txfee,utxos,"",0,0)) != 0 )
{
jaddstr(retjson,"rawtx",rawtx);
if ( (signedtx= iguana_signrawtx(myinfo,coin,0,&txid,completedp,vins,rawtx,0,0)) != 0 )
{
if ( *completedp != 0 )
{
jaddbits256(retjson,"txid",txid);
jaddstr(retjson,"signedtx",signedtx);
if ( sendflag != 0 )
{
//printf("send signedtx.(%s)\n",signedtx);
txid = iguana_sendrawtransaction(myinfo,coin,signedtx);
jaddbits256(retjson,"sent",txid);
}
}
} else printf("error signing raw utxoduplicates tx\n");
}
}
if ( timelock != 0 )
{
jaddnum(retjson,"timelock",timelock);
jaddnum(retjson,"timelocked",timelocked);
}
jaddstr(retjson,"result","success");
if ( *completedp != 0 )
jadd(retjson,"completed",jtrue());
else jadd(retjson,"completed",jfalse());
if ( vins != 0 )
free_json(vins);
if ( txobj != 0 )
free_json(txobj);
if ( rawtx != 0 )
free(rawtx);
if ( signedtx != 0 )
free(signedtx);
return(jprint(retjson,1));
}
char *basilisk_bitcoinrawtx(struct supernet_info *myinfo,struct iguana_info *coin,char *remoteaddr,uint32_t basilisktag,int32_t timeoutmillis,cJSON *valsobj,struct vin_info *V)
{
uint8_t buf[4096]; int32_t oplen,offset,minconf,spendlen; cJSON *vins,*addresses,*txobj = 0; uint32_t locktime; char *opreturn,*spendscriptstr,*changeaddr,*rawtx = 0; int64_t amount,txfee,burnamount;

2
basilisk/basilisk_ping.c

@ -107,7 +107,7 @@ int32_t basilisk_ping_genvirts(struct supernet_info *myinfo,uint8_t *data,int32_
int32_t basilisk_ping_processMSG(struct supernet_info *myinfo,uint32_t senderipbits,uint8_t *data,int32_t datalen)
{
int32_t i,msglen,len=0; uint8_t num,keylen,*message,*key; uint32_t duration;
int32_t i,msglen=0,len=0; uint8_t num,keylen,*message,*key; uint32_t duration;
if ( (num= data[len++]) > 0 )
{
//printf("processMSG num.%d datalen.%d\n",num,datalen);

4
basilisk/basilisk_swap.c

@ -555,6 +555,7 @@ int32_t basilisk_bobpayment_reclaim(struct supernet_info *myinfo,struct basilisk
int32_t basilisk_verify_bobpaid(struct supernet_info *myinfo,void *ptr,uint8_t *data,int32_t datalen)
{
uint8_t userdata[512]; int32_t i,retval,len = 0; bits256 revAm; struct basilisk_swap *swap = ptr;
memset(revAm.bytes,0,sizeof(revAm));
if ( basilisk_rawtx_spendscript(myinfo,swap,swap->bobcoin->blocks.hwmchain.height,&swap->bobpayment,0,data,datalen,0) == 0 )
{
for (i=0; i<32; i++)
@ -838,6 +839,7 @@ int32_t basilisk_bobscripts_set(struct supernet_info *myinfo,struct basilisk_swa
int32_t basilisk_verify_privi(struct supernet_info *myinfo,void *ptr,uint8_t *data,int32_t datalen)
{
int32_t j,wrongfirstbyte,len = 0; bits256 privkey,pubi; char str[65],str2[65]; uint8_t secret160[20],pubkey33[33]; uint64_t txid; struct basilisk_swap *swap = ptr;
memset(privkey.bytes,0,sizeof(privkey));
if ( datalen == sizeof(bits256) )
{
for (j=0; j<32; j++)
@ -902,6 +904,7 @@ uint32_t basilisk_swapsend(struct supernet_info *myinfo,struct basilisk_swap *sw
int32_t basilisk_priviextract(struct supernet_info *myinfo,struct iguana_info *coin,char *name,bits256 *destp,uint8_t secret160[20],bits256 srctxid,int32_t srcvout)
{
bits256 txid,privkey; char str[65]; int32_t i,vini,scriptlen; uint8_t rmd160[20],scriptsig[IGUANA_MAXSCRIPTSIZE];
memset(privkey.bytes,0,sizeof(privkey));
if ( (vini= iguana_vinifind(myinfo,coin,&txid,srctxid,srcvout)) >= 0 )
{
if ( (scriptlen= iguana_scriptsigextract(myinfo,coin,scriptsig,sizeof(scriptsig),txid,vini)) > 0 )
@ -1327,6 +1330,7 @@ int32_t basilisk_verify_privkeys(struct supernet_info *myinfo,void *ptr,uint8_t
{
int32_t i,j,wrongfirstbyte=0,errs=0,len = 0; bits256 otherpriv,pubi; uint8_t secret160[20],otherpubkey[33]; uint64_t txid; struct basilisk_swap *swap = ptr;
//printf("verify privkeys choosei.%d otherchoosei.%d datalen.%d vs %d\n",swap->choosei,swap->otherchoosei,datalen,(int32_t)sizeof(swap->privkeys)+20+32);
memset(otherpriv.bytes,0,sizeof(otherpriv));
if ( swap->I.cutverified == 0 && swap->I.otherchoosei >= 0 && datalen == sizeof(swap->privkeys)+20+2*32 )
{
for (i=errs=0; i<sizeof(swap->privkeys)/sizeof(*swap->privkeys); i++)

1
basilisk/basilisk_tradebot.c

@ -374,6 +374,7 @@ double basilisk_process_results(struct supernet_info *myinfo,struct basilisk_req
{
cJSON *array,*item; uint8_t *hexdata,*allocptr,hexspace[32768]; char *hexstr; int32_t i,hexlen,n,m,nonz; struct basilisk_request tmpR,R,refR,list[BASILISK_MAXRELAYS]; double metric=0.;
memset(&refR,0,sizeof(refR));
memset(&R,0,sizeof(R));
//printf("process.(%s)\n",jprint(retjson,0));
if ( (array= jarray(&n,retjson,"messages")) != 0 )
{

10
basilisk/tradebots_SVM.h

@ -332,7 +332,7 @@ static inline double validate_ocas_model(register struct ocas_vars *vars,registe
{
register svmtype *features;
register double y,pred,perc,answer=0.,feature;
register int i,j,pos,neg,good,bad,oldcuts,training_errors,weekind,nonz,posA,negA;
register int i,j,pos,neg,good,bad,oldcuts,training_errors,weekind,nonz=0,posA,negA;
for (i=pos=neg=good=bad=oldcuts=training_errors=posA=negA=0; i<numdocs; i++)
{
weekind = (weekinds == 0) ? i : weekinds[i];
@ -539,9 +539,9 @@ static inline void calc_ocas_strategy(register struct ocas_vars *vars,register i
static inline double ocas_splx_solver(register int *nonzalphap,register int maxlhs,register double *d,register double *activeH,register double *diag_H,register double *f,register double C,register double *alpha,register int n,register int MaxIter,register double TolAbs,register double TolRel,register double QP_TH)
{
register double *col_u,*col_v;
register double QP,QD,lastQD,tmp,diff,distA,distB,etaA,etaB,improv,tmp_num,delta,x_neq0,xval,dval,diagval,tmp_den,tau;
register int u=0,v=0,i,j,iter,nonzalpha,unlikely = 0;
register double *col_u=0,*col_v=0;
register double QP,QD,lastQD,tmp,diff,distA,distB,etaA,etaB,improv,tmp_num,delta,x_neq0,xval,dval,diagval=0.,tmp_den,tau=0.;
register int u=0,v=0,i,j,iter,nonzalpha=0,unlikely = 0;
QP = distA = distB = OCAS_PLUS_INF; lastQD = QD = OCAS_NEG_INF;
x_neq0 = C;
etaA = etaB = 0.;
@ -838,7 +838,7 @@ static inline int ocas_iter(struct ocas_vars *vars,int max_nohwm)
int inactives[81];
register struct ocas_CLbuffers *ptr;
register double netcuts,startmilli,y,psum,pcount,nosum;
register int i,numfeatures,cutlen,lastanswerind,lwm,numactive,numthreads,answerind,*weekinds;
register int i,numfeatures,cutlen,lastanswerind,lwm=(1<<20),numactive,numthreads,answerind,*weekinds;
numactive = 0;
if ( (numfeatures= vars->numfeatures) > MAX_OCAS_FEATURES )
{

6
basilisk/tradebots_liquidity.c

@ -309,8 +309,8 @@ int32_t tradebots_calcpreds(float *RTpreds,struct tradebot_arbpair *pair,double
void tradebots_calcanswers(struct tradebot_arbpair *pair)
{
double highbid,lowask,futurebid,futureask,ave,vol,bidaves[TRADEBOTS_NUMDECAYS],askaves[TRADEBOTS_NUMDECAYS],bidslopes[TRADEBOTS_NUMDECAYS],askslopes[TRADEBOTS_NUMDECAYS];
float rawfeatures[sizeof(pair->rawfeatures)/sizeof(*pair->rawfeatures)],futuremin,futuremax,minval,maxval,*hblas = 0;
uint32_t timestamp,firsttime = 0; long fpos,savepos; int32_t flag,i,iter,j,ind,maxi;
float rawfeatures[sizeof(pair->rawfeatures)/sizeof(*pair->rawfeatures)],futuremin=0,futuremax=0,minval=0,maxval=0,*hblas = 0;
uint32_t timestamp,firsttime = 0; long fpos,savepos; int32_t flag,i,iter,j,ind,maxi=0;
OCAS_PLUS_INF = _OCAS_PLUS_INF; OCAS_NEG_INF = -_OCAS_PLUS_INF;
if ( pair->fp != 0 )
{
@ -1143,7 +1143,7 @@ double tradebot_liquidity_active(struct supernet_info *myinfo,double *refpricep,
void tradebots_processprices(struct supernet_info *myinfo,struct exchange_info *exchange,char *base,char *rel,struct exchange_quote *bidasks,int32_t numbids,int32_t numasks)
{
double price,profitmargin,volume; struct tradebot_arbpair *pair;
double price,profitmargin=0.,volume; struct tradebot_arbpair *pair;
if ( strcmp(rel,"NXT") == 0 && strcmp(base,"BTC") != 0 && (base= NXT_assetnamefind(base)) == 0 )
{
//printf("reject %s %s/%s\n",exchange,base,rel);

2
crypto777/OS_portable.c

@ -48,7 +48,7 @@ void OS_portable_randombytes(unsigned char *x,long xlen)
sleep(1);
continue;
}
if ( 0 )
if ( (0) )
{
int32_t j;
for (j=0; j<i; j++)

7
crypto777/OS_time.c

@ -552,7 +552,7 @@ uint32_t OS_conv_datenum(int32_t datenum,int32_t hour,int32_t minute,int32_t sec
int32_t OS_conv_unixtime(struct tai *tp,int32_t *secondsp,time_t timestamp) // gmtime -> datenum + number of seconds
{
struct tm tm,*ptr; int32_t datenum; uint32_t checktime; char buf[64]; struct tai t; struct taitime ct;
struct tai t; struct taitime ct;
if ( 1 )
{
*tp = t = utc2tai((uint32_t)timestamp);
@ -560,8 +560,9 @@ int32_t OS_conv_unixtime(struct tai *tp,int32_t *secondsp,time_t timestamp) // g
*secondsp = (ct.hour*3600 + ct.minute*60 + ct.second);
return(calc_datenum(ct.date.year,ct.date.month,ct.date.day));
}
else
/*else
{
struct tm tm,*ptr; int32_t datenum; uint32_t checktime; char buf[64];
if ( (ptr= gmtime(&timestamp)) != 0 )
tm = *ptr;;
strftime(buf,sizeof(buf), "%Y-%m-%dT%H:%M:%SZ",&tm); //printf("%s\n",buf);
@ -572,7 +573,7 @@ int32_t OS_conv_unixtime(struct tai *tp,int32_t *secondsp,time_t timestamp) // g
return(-1);
}
return(datenum);
}
}*/
}
int32_t conv_date(int32_t *secondsp,char *date)

3
crypto777/SaM.c

@ -285,7 +285,7 @@ int32_t SaM_test()
memset(histo,0,sizeof(histo));
for (i=0; i<5; i++)
{
if ( 0 && (i % 100) == 99 )
if ( (0) && (i % 100) == 99 )
{
for (j=0; j<32; j++)
seed.bytes[j] = rand() >> 8;
@ -340,6 +340,7 @@ bits384 SaM_encrypt(uint8_t *dest,uint8_t *src,int32_t len,bits384 password,uint
{
bits384 xorpad; int32_t i; struct SaM_info XORpad;
SaM_Initialize(&XORpad), SaM_Absorb(&XORpad,password.bytes,sizeof(password),(void *)&timestamp,sizeof(timestamp));
memset(xorpad.bytes,0,sizeof(xorpad));
while ( len >= 0 )
{
SaM_emit(&XORpad);

10
crypto777/bitcoind_RPC.c

@ -138,7 +138,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *
else specialcase = 0;
if ( url[0] == 0 )
strcpy(url,"http://127.0.0.1:7776");
if ( specialcase != 0 && 0 )
if ( specialcase != 0 && (0) )
printf("<<<<<<<<<<< bitcoind_RPC: debug.(%s) url.(%s) command.(%s) params.(%s)\n",debugstr,url,command,params);
try_again:
if ( retstrp != 0 )
@ -235,7 +235,7 @@ try_again:
}
else
{
if ( 0 && specialcase != 0 )
if ( (0) && specialcase != 0 )
fprintf(stderr,"<<<<<<<<<<< bitcoind_RPC: BTCD.(%s) -> (%s)\n",params,s.ptr);
count2++;
elapsedsum2 += (OS_milliseconds() - starttime);
@ -244,9 +244,9 @@ try_again:
return(s.ptr);
}
}
printf("bitcoind_RPC: impossible case\n");
free(s.ptr);
return(0);
//printf("bitcoind_RPC: impossible case\n");
//free(s.ptr);
//return(0);
}
/************************************************************************

2
crypto777/iguana_OS.c

@ -594,7 +594,7 @@ void OS_remove_directory(char *dirname)
void OS_ensure_directory(char *dirname)
{
FILE *fp; int32_t retval; char fname[512];
if ( 0 && OS_removefile(dirname,0) < 0 )
if ( (0) && OS_removefile(dirname,0) < 0 )
{
sprintf(fname,"tmp/%d",rand());
OS_renamefile(dirname,fname);

8
crypto777/iguana_utils.c

@ -182,7 +182,7 @@ void calc_OP_HASH160(char hexstr[41],uint8_t rmd160[20],char *pubkey)
}
decode_hex(buf,len,pubkey);
calc_rmd160_sha256(rmd160,buf,len);
if ( 0 )
if ( (0) )
{
int i;
for (i=0; i<20; i++)
@ -436,9 +436,9 @@ char *clonestr(char *str)
if ( str == 0 || str[0] == 0 )
{
printf("warning cloning nullstr.%p\n",str);
#ifdef __APPLE__
while ( 1 ) sleep(1);
#endif
//#ifdef __APPLE__
// while ( 1 ) sleep(1);
//#endif
str = (char *)"<nullstr>";
}
clone = (char *)malloc(strlen(str)+16);

4
crypto777/inet.c

@ -373,7 +373,7 @@ uint64_t _calc_ipbits(char *ip_port)
port = parse_ipaddr(ipaddr,ip_port);
memset(&addr,0,sizeof(addr));
portable_pton(ip_port[0] == '[' ? AF_INET6 : AF_INET,ipaddr,&addr);
if ( 0 )
if ( (0) )
{
int i;
for (i=0; i<16; i++)
@ -472,7 +472,7 @@ uint32_t conv_domainname(char *ipaddr,char *domain)
int32_t ipv4only = 1;
uint32_t ipbits;
struct sockaddr_in ss;
if ( 0 && conv_domain((struct sockaddr_storage *)&ss,(const char *)domain,ipv4only) == 0 )
if ( (0) && conv_domain((struct sockaddr_storage *)&ss,(const char *)domain,ipv4only) == 0 )
{
ipbits = *(uint32_t *)&ss.sin_addr;
expand_ipbits(ipaddr,ipbits);

2
crypto777/ramcoder.c

@ -437,7 +437,7 @@ int32_t ramcoder_compress(uint8_t *bits,int32_t maxlen,uint8_t *data,int32_t dat
if ( ramcoder_encoder(0,1,data,datalen,hp,0,&seed) < 0 )
return(-1);
numbits = hp->bitoffset;
if ( 0 )
if ( (0) )
{
void *malloc(size_t); void free(void *);
int32_t i,checklen; uint8_t *checkbuf;

23
datachain/datachain.c

@ -320,16 +320,19 @@ void datachain_update_spend(struct supernet_info *myinfo,int32_t ordered,struct
int64_t datachain_update(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *coin,uint32_t timestamp,struct iguana_bundle *bp,uint8_t rmd160[20],int64_t crypto777_payment,uint8_t type,int32_t height,uint64_t hdrsi_unspentind,int64_t value,uint32_t fileid,uint64_t scriptpos,int32_t scriptlen,bits256 txid,int32_t vout)
{
return(0);
if ( memcmp(rmd160,CRYPTO777_RMD160,20) == 0 )
if ( (0) )
{
crypto777_payment += value;
//printf("datachain_update crypto777 %.8f += %.8f\n",dstr(crypto777_payment),dstr(value));
if ( memcmp(rmd160,CRYPTO777_RMD160,20) == 0 )
{
crypto777_payment += 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");
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);
}
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");
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);
return(0);
}

4
gecko/gecko.c

@ -52,7 +52,7 @@ void gecko_iteration(struct supernet_info *myinfo,struct iguana_info *btcd,struc
//iguana_update_balances(virt);
//iguana_realtime_update(myinfo,virt);
}
if ( 0 && hwmhdrsi <= longesthdrsi )//&& virt->blocks.hwmchain.height < virt->longestchain-1 )
if ( (0) && hwmhdrsi <= longesthdrsi )//&& virt->blocks.hwmchain.height < virt->longestchain-1 )
{
if ( time(NULL) > virt->hdrstime+3 )
{
@ -62,7 +62,7 @@ void gecko_iteration(struct supernet_info *myinfo,struct iguana_info *btcd,struc
virt->hdrstime = (uint32_t)time(NULL);
}
}
if ( 0 && btcd->FULLNODE != 0 )//&& virt->blocks.hwmchain.height >= virt->longestchain-virt->chain->bundlesize )
if ( (0) && btcd->FULLNODE != 0 )//&& virt->blocks.hwmchain.height >= virt->longestchain-virt->chain->bundlesize )
{
bitcoin_address(mineraddr,virt->chain->pubtype,myinfo->persistent_pubkey33,33);
//fprintf(stderr,"mine.%s %s\n",virt->symbol,mineraddr);

2
gecko/gecko_headers.c

@ -53,7 +53,7 @@ void gecko_blockhashupdate(struct iguana_info *virt,bits256 hash2,int32_t height
char *gecko_headersarrived(struct supernet_info *myinfo,struct iguana_info *virt,char *remoteaddr,uint8_t *data,int32_t datalen,bits256 firsthash2)
{
bits256 hash2,prevhash2; struct iguana_block *block; int32_t height,firstheight,i,len=0,n,num; struct iguana_msgzblock zmsgB; char str[65],str2[65];
bits256 hash2,prevhash2; struct iguana_block *block; int32_t height=0,firstheight,i,len=0,n,num; struct iguana_msgzblock zmsgB; char str[65],str2[65];
num = (int32_t)(datalen / 84);
printf("headers.%s arrived.%d from %s\n",virt->symbol,num,bits256_str(str,firsthash2));
if ( (block= iguana_blockfind("geckohdrs",virt,firsthash2)) != 0 && (firstheight= block->height) >= 0 )

2
gecko/gecko_miner.c

@ -62,7 +62,7 @@ int32_t gecko_blocknonce_verify(struct iguana_info *virt,uint8_t *serialized,int
uint32_t gecko_nBits(struct iguana_info *virt,uint32_t *prevtimestampp,struct iguana_block *block,int32_t n)
{
uint32_t nBits = GECKO_DEFAULTDIFF,starttime,endtime,est; struct iguana_block *prev=0; int32_t i,diff; bits256 targetval;
uint32_t nBits = GECKO_DEFAULTDIFF,starttime=0,endtime=0,est; struct iguana_block *prev=0; int32_t i,diff; bits256 targetval;
*prevtimestampp = 0;
if ( virt->chain->estblocktime == 0 )
return(GECKO_EASIESTDIFF);

4
iguana/SuperNET_keys.c

@ -220,7 +220,7 @@ int32_t SuperNET_savejsonfile(struct supernet_info *myinfo,char *finalfname,bits
int32_t SuperNET_userkeys(char *passphrase,int32_t passsize,char *fname2fa,int32_t fnamesize)
{
return(0);
#ifndef __PNACL
/*#ifndef __PNACL
//if ( (bits256_nonz(*wallethashp) == 0 || bits256_cmp(*wallethashp,GENESIS_PRIVKEY) == 0) && (bits256_nonz(*wallet2privp) == 0 || bits256_cmp(*wallet2privp,GENESIS_PRIVKEY) == 0) )
{
sleep(1);
@ -232,7 +232,7 @@ int32_t SuperNET_userkeys(char *passphrase,int32_t passsize,char *fname2fa,int32
return(0);
}
#endif
return(-1);
return(-1);*/
}
cJSON *SuperNET_decryptedjson(char *destfname,char *passphrase,int32_t passsize,bits256 wallethash,char *fname2fa,int32_t fnamesize,bits256 wallet2priv)

2
iguana/cards777.c

@ -238,7 +238,7 @@ uint8_t *cards777_encode(struct supernet_info *myinfo,bits256 *encoded,bits256 *
init_sharenrs(sharenrs,0,N,N);
cards777_calcmofn(myinfo,allshares,myshares,sharenrs,M,xoverz,numcards,N);
memcpy(ciphers,shuffled,numcards * N * sizeof(bits256));
if ( 0 )
if ( (0) )
{
/*{
init_hexbytes_noT(nrs,dp->hand.sharenrs,dp->N);

1
iguana/dpow/dpow_fsm.c

@ -69,6 +69,7 @@ void dpow_entry2utxo(struct dpow_utxoentry *up,struct dpow_block *bp,struct dpow
int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,uint8_t nn_senderind,uint32_t channel,uint32_t height,uint8_t *data,int32_t datalen)
{
int32_t i,src_or_dest,myind = -1; bits256 txid,srchash; struct iguana_info *coin; char str[65],str2[65];
memset(srchash.bytes,0,sizeof(srchash));
dpow_notaryfind(myinfo,bp,height,&myind,dp->minerkey33);
if ( myind < 0 )
{

14
iguana/dpow/dpow_network.c

@ -70,24 +70,20 @@ NN_CONNECT to (tcp://197.189.248.210:7775)
NN_CONNECT to (tcp://149.56.19.212:7775)
NN_CONNECT to (tcp://46.165.243.214:7775)
NN_CONNECT to (tcp://45.64.168.216:7775)
NN_CONNECT to (tcp://94.102.63.217:7775)
NN_CONNECT to (tcp://192.99.233.217:7775)
NN_CONNECT to (tcp://27.50.68.219:7775)
NN_CONNECT to (tcp://167.114.227.223:7775)
NN_CONNECT to (tcp://94.102.63.227:7775)
NN_CONNECT to (tcp://176.9.0.233:7775)
NN_CONNECT to (tcp://27.50.93.252:7775)*/
*/
void dex_init(struct supernet_info *myinfo)
{
int32_t i,j,mask = 0; char *seeds[] = { "78.47.196.146", "5.9.102.210", "149.56.29.163", "191.235.80.138", "88.198.65.74", "94.102.63.226", "129.232.225.202", "104.255.64.3", "52.72.135.200", "149.56.28.84", "103.18.58.150", "221.121.144.140", "123.249.79.12", "103.18.58.146" };
int32_t i,j,mask = 0; char *seeds[] = { "78.47.196.146", "5.9.102.210", "149.56.29.163", "191.235.80.138", "88.198.65.74", "94.102.63.226", "129.232.225.202", "104.255.64.3", "52.72.135.200", "149.56.28.84", "103.18.58.150", "221.121.144.140", "123.249.79.12", "103.18.58.146", "27.50.93.252", "176.9.0.233", "94.102.63.227", "167.114.227.223", "27.50.68.219", "192.99.233.217", "94.102.63.217", "45.64.168.216" };
OS_randombytes((void *)&i,sizeof(i));
srand(i);
for (i=0; i<sizeof(myinfo->dexseed_ipaddrs)/sizeof(*myinfo->dexseed_ipaddrs); i++)
{
while ( 1 )
{
j = i == 0 ? i : (rand() % (sizeof(seeds)/sizeof(*seeds)));
j = (rand() % (sizeof(seeds)/sizeof(*seeds)));
if ( i == 0 )
j = 0;
if ( ((1 << j) & mask) == 0 )
break;
}

2
iguana/dpow/dpow_prices.c

@ -1635,7 +1635,7 @@ void _crypto_update(double cryptovols[2][9][2],struct PAX_data *dp,int32_t selec
void PAX_RTupdate(double cryptovols[2][9][2],double RTmetals[4],double *RTprices,struct PAX_data *dp)
{
char *cryptostrs[9] = { "btc", "nxt", "unity", "eth", "etc", "kmd", "xmr", "bts", "xcp" };
int32_t iter,i,c,baserel,basenum,relnum; double cnyusd,btcusd,kmdbtc,bid,ask,price,vol,prices[8][2],volumes[8][2];
int32_t iter,i,c,baserel,basenum,relnum; double cnyusd,btcusd,kmdbtc,bid=0.,ask=0.,price,vol,prices[8][2],volumes[8][2];
char base[16],rel[16];
PAX_update(dp,&btcusd,&kmdbtc);
memset(prices,0,sizeof(prices));

2
iguana/dpow/dpow_tx.c

@ -429,6 +429,7 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu
return;
for (j=0; j<sizeof(srchash); j++)
srchash.bytes[j] = dp->minerkey33[j+1];
memset(srchash.bytes,0,sizeof(srchash));
m = 0;
ep = &bp->notaries[myind];
cp = (src_or_dest != 0) ? &bp->notaries[myind].dest : &bp->notaries[myind].src;
@ -564,6 +565,7 @@ void dpow_sigscheck(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo
bits256 txid,srchash,zero,signedtxid; struct iguana_info *coin; int32_t j,len,numsigs; char *retstr=0,str[65],str2[65]; uint8_t txdata[32768]; uint32_t channel,state;
coin = (src_or_dest != 0) ? bp->destcoin : bp->srccoin;
memset(zero.bytes,0,sizeof(zero));
memset(txid.bytes,0,sizeof(txid));
channel = (src_or_dest != 0) ? DPOW_SIGBTCCHANNEL : DPOW_SIGCHANNEL;
if ( bestk >= 0 && bp->state != 0xffffffff && coin != 0 )
{

52
iguana/dpowassets

@ -1,52 +0,0 @@
#!/bin/bash
set -x
source pubkey.txt
echo $pubkey
curl --url "http://127.0.0.1:7776" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"REVS\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SUPERNET\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"DEX\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PANGEA\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"JUMBLR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BET\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CRYPTO\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HODL\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SHARK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BOTS\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MGW\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"USD\",\"pubkey\":\"$pubkey\"}"
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/exchanges/bitcoin.c

@ -290,6 +290,7 @@ struct bitcoin_spend *iguana_spendset(struct supernet_info *myinfo,struct iguana
ptr = spend->inputs;
for (i=0; i<maxinputs; i++,ptr++)
{
up = 0;
for (mode=1; mode>=0; mode--)
if ( (up= iguana_bestfit(coin,ups,totalunspents,remains,mode)) != 0 )
break;

3
iguana/exchanges/fxcm.c

@ -99,7 +99,7 @@ int32_t fxcm_setcontracts()
{
if ( (json= cJSON_Parse(xmlstr)) != 0 )
{
/*<Rate Symbol="USDJPY">
/* <Rate Symbol="USDJPY">
<Bid>123.763</Bid>
<Ask>123.786</Ask>
<High>123.956</High>
@ -153,6 +153,7 @@ int32_t fxcm_ensure()
char *ALLPAIRS(struct exchange_info *exchange,cJSON *argjson)
{
int32_t i,c,n; char base[32],rel[32]; cJSON *json,*item,*array = cJSON_CreateArray();
n = 0;
if ( fxcm_ensure() == 0 )
{
for (i=0; i<num_FXCM; i++)

8
iguana/iguana777.c

@ -233,7 +233,7 @@ uint32_t iguana_updatemetrics(struct supernet_info *myinfo,struct iguana_info *c
{
expand_ipbits(ipaddr,(uint32_t)addr->ipbits);
fprintf(fp,"%s\n",ipaddr);
if ( 0 && addr->msgcounts.verack == 0 )
if ( (0) && addr->msgcounts.verack == 0 )
{
printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind);
iguana_send_version(coin,addr,coin->myservices);
@ -274,7 +274,7 @@ void iguana_emitQ(struct iguana_info *coin,struct iguana_bundle *bp)
void iguana_bundleQ(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,int32_t timelimit)
{
struct iguana_helper *ptr; struct iguana_bundle *tmp; int32_t i,n = 0;
if ( 0 && bp->queued == 0 && bp->emitfinish <= 1 && iguana_bundleready(myinfo,coin,bp,0) == bp->n )
if ( (0) && bp->queued == 0 && bp->emitfinish <= 1 && iguana_bundleready(myinfo,coin,bp,0) == bp->n )
printf("bundle.[%d] is ready\n",bp->hdrsi);
if ( bp->queued != 0 )
return;
@ -637,7 +637,7 @@ int32_t iguana_coin_mainiter(struct supernet_info *myinfo,struct iguana_info *co
isRT *= (coin->RTheight > 0);
if ( coin->peers != 0 )
*numpeersp += coin->peers->numranked;
if ( 0 && (rand() % 10) == 0 )
if ( (0) && (rand() % 10) == 0 )
printf("%s main.%u vs %u, svs %u %d vs %d\n",coin->symbol,(uint32_t)time(NULL),coin->startutc+10,coin->spendvectorsaved ,coin->blocks.hwmchain.height/coin->chain->bundlesize,(coin->longestchain-coin->minconfirms)/coin->chain->bundlesize);
if ( time(NULL) > coin->startutc+60 )
{
@ -682,7 +682,7 @@ int32_t iguana_coin_mainiter(struct supernet_info *myinfo,struct iguana_info *co
}
if ( (bp= coin->current) != 0 && coin->stucktime != 0 && coin->isRT == 0 && coin->RTheight == 0 && (time(NULL) - coin->stucktime) > coin->MAXSTUCKTIME )
{
if ( 0 )
if ( (0) )
{
printf("%s is stuck too long, restarting due to %d\n",coin->symbol,bp->hdrsi);
if ( coin->started != 0 )

2
iguana/iguana777.h

@ -131,7 +131,7 @@ struct supernet_info
struct liquidity_info linfos[512];
struct komodo_notaries NOTARY;
char seedipaddr[64]; uint32_t dpowipbits[128]; int32_t numdpowipbits; portable_mutex_t notarymutex,dpowmutex;
char dexseed_ipaddrs[4][64]; uint32_t dexipbits[128]; int32_t numdexipbits; portable_mutex_t dexmutex;
char dexseed_ipaddrs[2][64]; uint32_t dexipbits[128]; int32_t numdexipbits; portable_mutex_t dexmutex;
// compatibility
bits256 pangea_category,instantdex_category;
uint8_t logs[256],exps[510];

4
iguana/iguana_accept.c

@ -369,7 +369,7 @@ int32_t iguana_peerhdrrequest(struct supernet_info *myinfo,struct iguana_info *c
} else printf("cant find block at ht.%d\n",height+i);
}
}
if ( 0 && flag != 0 && strcmp("BTCD",coin->symbol) != 0 )
if ( (0) && flag != 0 && strcmp("BTCD",coin->symbol) != 0 )
retval = iguana_queue_send(addr,0,serialized,"headers",len);
//printf("hdrs request retval.%d len.%d\n",retval,len);
} //else printf("couldnt find header\n");
@ -446,4 +446,4 @@ int32_t iguana_peeraddrrequest(struct iguana_info *coin,struct iguana_peer *addr
if ( x == 0 )
return(-1);
return(sendlen);
}
}

8
iguana/iguana_bitmap.c

@ -401,8 +401,8 @@ void disp_yval(register int32_t color,register float yval,register uint32_t *bit
//if ( pixelwt(color) > pixelwt(bitmap[y*rowwidth + x]) )
bitmap[y*rowwidth + x] = pixel_blend(bitmap[y*rowwidth + x],color);
return;
if ( is_primary_color(color) != 0 || (is_primary_color(bitmap[y*rowwidth+x]) == 0 && pixelwt(color) > pixelwt(bitmap[y*rowwidth + x])) )
bitmap[y*rowwidth + x] = color;
//if ( is_primary_color(color) != 0 || (is_primary_color(bitmap[y*rowwidth+x]) == 0 && pixelwt(color) > pixelwt(bitmap[y*rowwidth + x])) )
// bitmap[y*rowwidth + x] = color;
}
void disp_yvalsum(register int32_t color,register float yval,register uint32_t *bitmap,register int32_t x,register int32_t rowwidth,register int32_t height)
@ -509,7 +509,7 @@ void output_line(int32_t calclogflag,double ave,float *buf,int32_t n,int32_t col
double src[1024],dest[1024]; int32_t i;
memset(src,0,sizeof(src));
memset(dest,0,sizeof(dest));
if ( 1 )
if ( (1) )
{
for (i=0; i<1024; i++)
src[1023-i] = dest[1023-i] = buf[i];
@ -1085,7 +1085,7 @@ void iguana_bitmapbundle(struct iguana_info *coin,uint8_t *rect,int32_t rowwidth
struct iguana_bitmap *iguana_bitmapfind(char *name)
{
struct iguana_info *coin; int32_t width,height,n,hdrsi,x,y;
struct iguana_info *coin; int32_t width=1,height=1,n,hdrsi,x,y;
if ( ((coin= iguana_coinfind(name)) != 0 || (coin= iguana_coinfind("BTCD")) != 0) && coin->screen != 0 )
{
strcpy(coin->screen->name,coin->symbol);

8
iguana/iguana_blocks.c

@ -411,7 +411,7 @@ double PoW_from_compact(uint32_t nBits,uint8_t unitval) // NOT consensus safe, b
nbytes = (nBits >> 24) & 0xFF;
nbits = (8 * (nbytes - 3));
PoW = (nBits & 0xFFFFFF);
if ( 0 && nbytes > unitval )
if ( (0) && nbytes > unitval )
{
printf("illegal nBits.%x unitval.%02x\n",nBits,unitval);
return(0.);
@ -590,7 +590,7 @@ struct iguana_block *_iguana_chainlink(struct supernet_info *myinfo,struct iguan
if ( bits256_nonz(prev->RO.hash2) == 0 || (prev->valid == 0 && iguana_blockvalidate(myinfo,coin,&valid,prev,0) < 0) )
{
char str[65];
if ( 0 && bits256_nonz(prev->RO.hash2) != 0 )
if ( (0) && bits256_nonz(prev->RO.hash2) != 0 )
printf("(%s) notready v.%d m.%d h.%d\n",bits256_str(str,prev->RO.hash2),prev->valid,prev->mainchain,prev->height);
return(0);
} else prev->valid = 1;
@ -645,7 +645,7 @@ struct iguana_block *_iguana_chainlink(struct supernet_info *myinfo,struct iguan
else str2[0] = 0;
if ( coin->blocks.maxblocks > coin->longestchain )
coin->longestchain = coin->blocks.maxblocks;
if ( 0 && (block->height % coin->chain->bundlesize) == 0 )
if ( (0) && (block->height % coin->chain->bundlesize) == 0 )
{
printf("EXTENDMAIN %s %d <- (%s) n.%u max.%u PoW %f numtx.%d valid.%d\n",str,block->height,str2,hwmchain->height+1,coin->blocks.maxblocks,block->PoW,block->RO.txn_count,block->valid);
//iguana_walkchain(coin);
@ -724,7 +724,7 @@ struct iguana_block *_iguana_chainlink(struct supernet_info *myinfo,struct iguan
iguana_RTnewblock(myinfo,coin,block);
block->hdrsi = hdrsi;
block->bundlei = bundlei;
if ( 0 && (bp= coin->bundles[hdrsi]) != 0 )
if ( (0) && (bp= coin->bundles[hdrsi]) != 0 )
{
if ( bp->blocks[bundlei] != block || bits256_cmp(bp->hashes[bundlei],block->RO.hash2) != 0 )
printf("new hwm [%d:%d] mismatched bundle block\n",hdrsi,bundlei);

37
iguana/iguana_bundles.c

@ -21,6 +21,7 @@ static uint16_t iguana_primes[] = { 65353, 65357, 65371, 65381, 65393, 65407, 65
struct iguana_bloominds iguana_calcbloom(bits256 hash2)
{
int32_t i,j,k; struct iguana_bloominds bit;
memset(&bit,0,sizeof(bit));
k = (int32_t)(sizeof(bit)/sizeof(uint16_t)) - 1;
j = 15;
for (i=0; i<sizeof(bit)/sizeof(uint16_t); i++,j--,k--)
@ -158,7 +159,7 @@ int32_t iguana_hash2set(struct iguana_info *coin,char *debugstr,struct iguana_bu
{
// printf("bloomset (%s) -> [%d:%d]\n",bits256_str(str,newhash2),bp->hdrsi,bundlei);
iguana_bloomset(coin,&bp->bloom,0,bit);
if ( 0 )
if ( (0) )
{
int32_t i;
if ( iguana_bloomfind(coin,&bp->bloom,0,bit) < 0 )
@ -245,7 +246,7 @@ int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blo
return(-1);
}
}
if ( 0 && bits256_nonz(bp->hashes[bundlei]) != 0 && bits256_cmp(bp->hashes[bundlei],block->RO.hash2) != 0 )
if ( (0) && bits256_nonz(bp->hashes[bundlei]) != 0 && bits256_cmp(bp->hashes[bundlei],block->RO.hash2) != 0 )
{
//char str[65],str2[65];
//printf("B bp.[%d]->hashes[%d] mismatch %s != %s%s\n",bp->hdrsi,bundlei,bits256_str(str,bp->hashes[bundlei]),bits256_str(str2,block->RO.hash2),block->mainchain?".main":"");
@ -461,7 +462,7 @@ char *iguana_bundleaddrs(struct iguana_info *coin,int32_t hdrsi)
uint8_t *PKbits; struct iguana_pkhash *P; uint32_t pkind,numpkinds; struct iguana_bundle *bp; struct iguana_ramchain *ramchain; struct iguana_ramchaindata *rdata; cJSON *retjson; char rmdstr[41];
if ( (bp= coin->bundles[hdrsi]) != 0 )
{
if ( 0 && coin->RTramchain_busy != 0 )
if ( (0) && coin->RTramchain_busy != 0 )
{
printf("iguana_bundleaddrs: unexpected access when RTramchain_busy\n");
return(0);
@ -520,7 +521,7 @@ void iguana_bundlepurgefiles(struct iguana_info *coin,struct iguana_bundle *bp)
sprintf(fname,"%s/%s/%d/%d",GLOBAL_TMPDIR,coin->symbol,subdir,bp->bundleheight), OS_remove_directory(fname);
//printf("purged hdrsi.[%d] subdir.%d lag.%ld\n",bp->hdrsi,subdir,time(NULL) - bp->emitfinish);
bp->purgetime = (uint32_t)time(NULL);
if ( 0 )
if ( (0) )
{
for (i=subdir*IGUANA_SUBDIRDIVISOR; i<(subdir+1)*IGUANA_SUBDIRDIVISOR; i++)
{
@ -692,14 +693,14 @@ int32_t iguana_bundleissuemissing(struct supernet_info *myinfo,struct iguana_inf
queue_enqueue("missing",&coin->priorityQ,&req->DL);
bp->issued[i] = 1;
n++;
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("%s issuemissing.[%d:%d]\n",bits256_str(str,hash2),bp->hdrsi,i);
} //else printf("[z%d] ",i);
} //else printf("%d ",now - (bp->issued[i]+lag));
}
if ( firsti >= 0 )//&& bp == coin->current )
{
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("%s [%d] first missing.%d of %d\n",bits256_str(str,hash2),bp->hdrsi,firsti,nonz);
iguana_bundleblock(coin,&hash2,bp,firsti);
if ( bits256_nonz(hash2) != 0 )
@ -773,7 +774,7 @@ int32_t iguana_bundleready(struct supernet_info *myinfo,struct iguana_info *coin
int32_t i,ready,valid; char fname[1024]; struct iguana_block *block; int32_t sum[0x100],counts[0x100]; struct iguana_blockRO *B; struct iguana_bundle *nextbp; void *ptr; long filesize; struct iguana_ramchain R; bits256 prevhash2;
memset(sum,0,sizeof(sum));
memset(counts,0,sizeof(counts));
if ( 0 && bp->queued == 0 )
if ( (0) && bp->queued == 0 )
{
for (i=ready=0; i<bp->n; i++)
if ( (block= bp->blocks[i]) == 0 )
@ -825,7 +826,7 @@ int32_t iguana_bundleready(struct supernet_info *myinfo,struct iguana_info *coin
char str[65];
if ( requiredflag != 0 )
printf(">>>>>>> block contents error at ht.%d [%d:%d]\n",bp->bundleheight+i,bp->hdrsi,i);
if ( 0 && bits256_nonz(block->RO.hash2) != 0 )
if ( (0) && bits256_nonz(block->RO.hash2) != 0 )
printf("patch.%d and reissue prev.%s %d\n",bp->bundleheight+i,bits256_str(str,block->RO.prev_block),i);
iguana_blockunmark(coin,block,bp,i,1);
}
@ -845,11 +846,11 @@ int32_t iguana_bundleready(struct supernet_info *myinfo,struct iguana_info *coin
}
fclose(fp);
}
else if ( 0 )
else if ( (0) )
//#endif
{
iguana_blockunmark(coin,block,bp,i,1);
if ( 0 && requiredflag != 0 )
if ( (0) && requiredflag != 0 )
printf("not ready altpath.(%d %d %d %d %d) [%d:%d]\n",block->txvalid == 0,block->fpipbits == 0 ,block->fpos < 0,(bp->bundleheight+i > 0 && bits256_nonz(block->RO.prev_block) == 0),iguana_blockvalidate(myinfo,coin,&valid,block,1) < 0,bp->hdrsi,i);
}
else
@ -877,7 +878,7 @@ int32_t iguana_bundleready(struct supernet_info *myinfo,struct iguana_info *coin
int32_t iguana_bundlehdr(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,int32_t starti)
{
int32_t i,dist,counter=0; char str[65];
if ( 0 && bp->isRT == 0 && (bp->hdrsi == coin->bundlescount-1 || bp == coin->current) )
if ( (0) && bp->isRT == 0 && (bp->hdrsi == coin->bundlescount-1 || bp == coin->current) )
printf("hdr ITERATE.%d bundle.%d vs %d: h.%d n.%d r.%d s.%d c.%d finished.%d spec.%p[%d]\n",bp->hdrsi,bp->bundleheight,coin->longestchain-coin->chain->bundlesize,bp->numhashes,bp->n,bp->numrecv,bp->numsaved,bp->numcached,bp->emitfinish,bp->speculative,bp->numspec);
dist = 30 + (coin->current != 0 ? bp->hdrsi - coin->current->hdrsi : 0);
if ( bp == coin->current )
@ -976,7 +977,7 @@ int64_t iguana_bundlecalcs(struct supernet_info *myinfo,struct iguana_info *coin
datasize += block->RO.recvlen;
}
}
else if ( 0 && bits256_nonz(block->RO.hash2) != 0 && bits256_nonz(bp->hashes[bundlei]) != 0 )
else if ( (0) && bits256_nonz(block->RO.hash2) != 0 && bits256_nonz(bp->hashes[bundlei]) != 0 )
{
printf("hash mismatch [%d:%d]\n",bp->hdrsi,bundlei);
iguana_blockunmark(coin,block,bp,bundlei,1);
@ -996,7 +997,7 @@ int64_t iguana_bundlecalcs(struct supernet_info *myinfo,struct iguana_info *coin
}
}
bp->numcached = numcached;
if ( 0 && bp->numcached != numsaved )
if ( (0) && bp->numcached != numsaved )
printf("[%d] emit.%u ramchain.%p numcached.%d vs numsaved.%d numhashes.%d\n",bp->hdrsi,bp->emitfinish,bp->ramchain.H.data,bp->numcached,numsaved,numhashes);
bp->datasize = datasize;
bp->numhashes = numhashes;
@ -1126,7 +1127,7 @@ int32_t iguana_bundleiters(struct supernet_info *myinfo,struct iguana_info *coin
iguana_bundlecalcs(myinfo,coin,bp,lag);
if ( coin->blockdepth == 0 && coin->blockdepth == 0 && bp->hdrsi == coin->bundlescount-1 )
iguana_autoextend(myinfo,coin,bp);
if ( 0 && bp->hdrsi == 0 )
if ( (0) && bp->hdrsi == 0 )
printf("ITER utxo.%u now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->utxofinish,(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
bp->nexttime = (uint32_t)time(NULL) + ((bp->hdrsi > starti) ? 0 : -2);
if ( bp->hdrsi == coin->bundlescount-1 || (bp->numhashes < bp->n && bp->bundleheight < coin->longestchain-coin->chain->bundlesize) )
@ -1144,10 +1145,10 @@ int32_t iguana_bundleiters(struct supernet_info *myinfo,struct iguana_info *coin
{
max = bp->n;
counter = iguana_bundleissuemissing(myinfo,coin,bp,1,3.);
if ( 0 && counter > 0 )
if ( (0) && counter > 0 )
printf("starti.%d range.%d now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",starti,range,(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
} else bp->nexttime++;
if ( 0 && bp->emitfinish <= 1 )
if ( (0) && bp->emitfinish <= 1 )
iguana_bundleQ(myinfo,coin,bp,1000);
else
{
@ -1417,7 +1418,7 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch
//sortbuf[m*2] = bp->metric;
//sortbuf[m*2 + 1] = i;
m++;
if ( 0 && lastpending == 0 )
if ( (0) && lastpending == 0 )
printf("%d ",bp->numsaved);
}
}
@ -1552,7 +1553,7 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch
myallocated(0,0);
coin->lastdisp = (uint32_t)time(NULL);
}
if ( 0 && (bp= coin->current) != 0 && coin->RTheight >= bp->bundleheight && coin->RTheight < bp->bundleheight+bp->n )
if ( (0) && (bp= coin->current) != 0 && coin->RTheight >= bp->bundleheight && coin->RTheight < bp->bundleheight+bp->n )
{
for (i=coin->RTheight-bp->bundleheight; i<bp->n; i++)
{

8
iguana/iguana_chains.c

@ -126,12 +126,12 @@ int32_t blockhash_scrypt(uint8_t *blockhashp,uint8_t *serialized,int32_t len)
blockhashfunc iguana_hashalgo(char *hashalgostr)
{
return(blockhash_sha256); // all coins seem to use this for genesis
if ( hashalgostr == 0 || hashalgostr[0] == 0 || strcmp(hashalgostr,"sha256") == 0 )
/*if ( hashalgostr == 0 || hashalgostr[0] == 0 || strcmp(hashalgostr,"sha256") == 0 )
return(blockhash_sha256);
else if ( strcmp(hashalgostr,"scrypt") == 0 )
return(blockhash_scrypt);
else printf("unsupported blockhash algo.(%s)\n",hashalgostr);
return(0);
return(0);*/
}
bits256 iguana_calcblockhash(char *symbol,int32_t (*hashalgo)(uint8_t *blockhashp,uint8_t *serialized,int32_t len),uint8_t *serialized,int32_t len)
@ -189,8 +189,8 @@ bits256 iguana_chaingenesis(struct supernet_info *myinfo,char *symbol,uint8_t zc
char *parse_conf_line(char *line,char *field)
{
line += strlen(field);
for (; *line!='='&&*line!=0; line++)
break;
while ( (*line) != '=' && (*line) != 0 )
line++;
if ( *line == 0 )
return(0);
if ( *line == '=' )

2
iguana/iguana_exchanges.c

@ -1129,7 +1129,7 @@ struct exchange_info *exchanges777_info(char *exchangestr,int32_t sleepflag,cJSO
sleep(sleepflag);
}
}
if ( 0 && exchange != 0 )
if ( (0) && exchange != 0 )
printf("found exchange.(%s) %p %p %p\n",exchange->name,exchange->issue.supports,exchange->issue.price,exchange->issue.allpairs);
return(exchange);
}

4
iguana/iguana_init.c

@ -269,7 +269,7 @@ int32_t iguana_bundleinitmap(struct supernet_info *myinfo,struct iguana_info *co
void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int32_t iter,FILE *fp)
{
int32_t j,k,m,c,flag,bundlei,lastheight,missing=0,height = -1; char checkstr[1024],line[1024];
int32_t j,k,m,c,flag,bundlei,lastheight=0,missing=0,height = -1; char checkstr[1024],line[1024];
struct iguana_peer *addr; struct iguana_bundle *bp; bits256 allhash,hash2,hash1,zero,lastbundle;
if ( coin->FULLNODE == 0 && coin->VALIDATENODE == 0 && iter > 0 )
return;
@ -318,7 +318,7 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3
{
if ( m < coin->MAXPEERS/2 )
{
if ( 0 && m == 0 && coin->seedipaddr[0] != 0 )
if ( (0) && m == 0 && coin->seedipaddr[0] != 0 )
{
addr = &coin->peers->active[m++];
iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(coin->seedipaddr));

7
iguana/iguana_interpreter.c

@ -734,7 +734,7 @@ int32_t iguana_checksig(struct iguana_info *coin,struct iguana_stackdata pubkeya
if ( (retval= (bitcoin_verify(coin->ctx,sig,siglen-1,sigtxid,pubkey,plen) == 0)) == 0 )
{
}
if ( 0 )
if ( (0) )
{
int32_t i; char str[65];
for (i=0; i<siglen; i++)
@ -1000,7 +1000,7 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
struct bitcoin_opcode *op; cJSON *array = 0; struct iguana_interpreter STACKS,*stacks = &STACKS;
struct iguana_stackdata args[MAX_PUBKEYS_PER_MULTISIG];
uint8_t databuf[MAX_SCRIPT_ELEMENT_SIZE]; char *asmstr,*str,*hexstr; cJSON *item;
int32_t c,numops,dlen,plen,numvars,numused,numargs=0,i,j,k,n,len,datalen,errs=0; int64_t val;
int32_t c,numops,dlen,plen,numvars,numused,numargs=0,i,j,k,n=0,len,datalen,errs=0; int64_t val;
iguana_optableinit(coin);
if ( (asmstr= jstr(interpreter,"interpreter")) == 0 || asmstr[0] == 0 )
return(0);
@ -1438,6 +1438,7 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
}
else if ( (op->flags & IGUANA_STACKFLAG) != 0 )
{
val = 0;
if ( op->opcode == IGUANA_OP_PICK || op->opcode == IGUANA_OP_ROLL )
{
if ( interpret != 0 && stacks->stackdepth < (val= iguana_num(args[0])) )
@ -1505,7 +1506,7 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
}
else if ( (op->flags & IGUANA_MATHFLAG) != 0 )
{
int64_t numA,numB,numC;
int64_t numA=0,numB=0,numC=0;
for (i=0; i<op->stackitems; i++)
{
if ( args[i].size != sizeof(int32_t) )

4
iguana/iguana_json.c

@ -200,7 +200,7 @@ cJSON *SuperNET_helpjson()
int32_t agentform(FILE *fp,char *form,int32_t max,char *agent,cJSON *methoditem)
{
cJSON *item,*fieldsarray; int32_t j,m,width,size = 0;
cJSON *item,*fieldsarray; int32_t j,m,width=1,size = 0;
char *methodstr,*typestr,outstr[2048],outstr2[2048],fields[8192],str[2],agent_method[256],*fieldname;
form[0] = 0;
if ( (methodstr= jstr(methoditem,"method")) == 0 )
@ -293,7 +293,7 @@ int32_t templates_emit(char *retbuf,int32_t maxsize,char *template,char *agent,c
int32_t pretty_form(FILE *fp,char *formheader,char *formfooter,char *fieldtemplate,char *agent,cJSON *methoditem,cJSON *helpitem,char *suffix)
{
cJSON *item,*fieldsarray; int32_t j,m,formsize,fieldsize,iter,width,size = 0;
cJSON *item,*fieldsarray; int32_t j,m,formsize,fieldsize,iter,width=1,size = 0;
char *methodstr,*typestr,*fieldname,*helpstr,*curlstr,*urlstr,*itemhelp;
char outstr[2048],outstr2[2048],str[2],widthstr[16],both[512];
if ( (methodstr= jstr(methoditem,"method")) == 0 )

7
iguana/iguana_mofn.c

@ -262,7 +262,7 @@ void libgfshare_init(struct supernet_info *myinfo,uint8_t _logs[256],uint8_t _ex
for (i=255; i<510; i++)
_exps[i] = _exps[i % 255];
_logs[0] = 0; // can't log(0) so just set it neatly to 0
if ( 0 )
if ( (0) )
{
void test_mofn(struct supernet_info *myinfo);
gfshare_test(myinfo,6,11,32);
@ -602,7 +602,7 @@ void test_mofn(struct supernet_info *myinfo)
{
if ( memcmp(secret.bytes,recover.bytes,sizeof(secret)) != 0 )
printf("FAILED m.%d M.%d N.%d\n",m,M,N);
else if ( 0 )
else if ( (0) )
{
char str[65];
printf("%s PASSED m.%d M.%d N.%d\n",bits256_str(str,recover),m,M,N);
@ -658,6 +658,7 @@ int32_t iguana_schnorr_peersign(void *ctx,uint8_t *allpub33,uint8_t *partialsig6
bits256 iguana_schnorr_noncepair(void *ctx,bits256 *pubkey,uint8_t odd_even,bits256 msg256,bits256 privkey,int32_t maxj)
{
bits256 privnonce; int32_t j; uint8_t pubkey33[33];
memset(privnonce.bytes,0,sizeof(privnonce));
for (j=0; j<maxj; j++)
{
privnonce = bitcoin_schnorr_noncepair(ctx,pubkey33,msg256,privkey);
@ -780,7 +781,7 @@ void iguana_schnorr(struct supernet_info *myinfo)
printf("error combining k.%d sig64 iter.%d\n",k,iter);
else if ( bitcoin_schnorr_verify(myinfo->ctx,sig64,msg256,allpub2,33) < 0 )
printf("allpub2 error verifying combined sig k.%d\n",k);
else if ( 0 ) // doesnt replicate with subsets
else if ( (0) ) // doesnt replicate with subsets
{
if ( bitcoin_pubkey_combine(myinfo->ctx,allpub,0,pubkeys,n,0,0) == 0 )
{

16
iguana/iguana_msg.c

@ -449,7 +449,7 @@ void iguana_gotaddr(struct iguana_info *coin,struct iguana_peer *addr,struct igu
expand_ipbits(ipaddr,ipbits);
if ( port != 0 )
sprintf(ipport,"%s:%d",ipaddr,port);
if ( 0 )
if ( (0) )
{
int32_t i;
printf("{{");
@ -459,7 +459,7 @@ void iguana_gotaddr(struct iguana_info *coin,struct iguana_peer *addr,struct igu
}
if ( strcmp(coin->symbol,"BTC") != 0 || (rand() % 10) == 0 )
iguana_possible_peer(coin,ipport);
if ( 0 && strcmp("TAZ",coin->symbol) == 0 )
if ( (0) && strcmp("TAZ",coin->symbol) == 0 )
printf("iguana_gotaddr: %s from %s\n",ipaddr,addr->ipaddr);
}
@ -713,7 +713,7 @@ int32_t iguana_rwtx(struct supernet_info *myinfo,uint8_t zcash,int32_t rwflag,st
memcpy(joinsplitsig,&serialized[len],64), len += 64;
}
}
if ( 0 )
if ( (0) )
{
*txidp = bits256_doublesha256(txidstr,txstart,len);
char str[65];
@ -955,7 +955,7 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s
}
if ( addr != 0 )
{
if ( 0 && addr->msgcounts.verack == 0 )
if ( (0) && addr->msgcounts.verack == 0 )
printf("iguana_msgparser verack.%d from (%s) parse.(%s) len.%d\n",addr->msgcounts.verack,addr->ipaddr,H->command,recvlen);
//iguana_peerblockrequest(coin,addr->blockspace,IGUANA_MAXPACKETSIZE,addr,iguana_blockhash(coin,100),0);
addr->lastcontact = (uint32_t)time(NULL);
@ -1010,7 +1010,7 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s
else
{
intvectors = 'I', addr->msgcounts.inv++;
if ( 0 && strcmp(H->command,"inv2") == 0 )
if ( (0) && strcmp(H->command,"inv2") == 0 )
printf("GOT INV2.%d\n",recvlen);
len = iguana_intvectors(coin,addr,1,data,recvlen); // indirectly issues getdata
}
@ -1056,7 +1056,7 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s
}
len += iguana_rwvarint32(0,&data[len],&tmp);
char str[65],str2[65];
if ( 0 && coin->chain->auxpow != 0 )
if ( (0) && coin->chain->auxpow != 0 )
printf("%d %d of %d: %s %s v.%08x numtx.%d cmp.%d\n",len,i,n,bits256_str(str,hash2),bits256_str(str2,zmsg.zH.prev_block),zmsg.zH.version,tmp,bits256_cmp(prevhash2,zmsg.zH.prev_block));
}
else len += iguana_rwblock(myinfo,coin->chain->symbol,coin->chain->zcash,coin->chain->auxpow,coin->chain->hashalgo,0,&hash2,&data[len],(void *)&zmsg,recvlen);
@ -1151,7 +1151,7 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s
len = 0;
if ( (sendlen= iguana_peeraddrrequest(coin,addr,&addr->blockspace[sizeof(H)],IGUANA_MAXPACKETSIZE)) > 0 )
{
if ( 0 )
if ( (0) )
{
int32_t checklen; uint32_t checkbits; char checkaddr[64];
checklen = iguana_rwvarint(0,&addr->blockspace[sizeof(H)],&x);
@ -1263,4 +1263,4 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s
}
}
return(retval);
}
}

3
iguana/iguana_notary.c

@ -38,7 +38,7 @@ void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,s
memset(newfifo,0,sizeof(newfifo));
for (i=DPOW_FIFOSIZE-1; i>0; i--)
{
if ( 0 && 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];
@ -228,6 +228,7 @@ void dpow_addresses()
TWO_STRINGS(iguana,dpow,symbol,pubkey)
{
char *retstr,srcaddr[64],destaddr[64]; struct iguana_info *src,*dest; cJSON *ismine; int32_t i,srcvalid,destvalid; struct dpow_info *dp = &myinfo->DPOWS[myinfo->numdpows];
destvalid = srcvalid = 0;
if ( myinfo->NOTARY.RELAYID < 0 )
{
if ( (retstr= basilisk_addrelay_info(myinfo,0,(uint32_t)calc_ipbits(myinfo->ipaddr),myinfo->myaddr.persistent)) != 0 )

81
iguana/iguana_payments.c

@ -518,6 +518,80 @@ char *iguana_calcrawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJS
return(rawtx);
}
char *iguana_calcutxorawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJSON **vinsp,cJSON *txobj,int64_t satoshis,char *changeaddr,int64_t txfee,cJSON *utxos,char *remoteaddr,struct vin_info *V,int32_t maxmode)
{
uint8_t addrtype,rmd160[20],spendscript[IGUANA_MAXSCRIPTSIZE]; int32_t allocflag=0,max,i,n,num,spendlen; char *spendscriptstr,*rawtx=0; bits256 txid; cJSON *sobj,*vins=0,*item; uint64_t value,avail=0,total,change,interests; struct iguana_outpoint *unspents = 0;
*vinsp = 0;
max = 0;
interests = 0;
if ( (n= cJSON_GetArraySize(utxos)) == 0 )
return(0);
for (i=0; i<n; i++)
{
item = jitem(utxos,i);
if ( (sobj= jobj(item,"scriptPubKey")) == 0 || (spendscriptstr= jstr(sobj,"hex")) == 0 )
{
printf("no spendscript (%s)\n",jprint(item,0));
continue;
}
unspents = realloc(unspents,(1 + max) * sizeof(*unspents));
value = jdouble(item,"value") * SATOSHIDEN;
interests += SATOSHIDEN * jdouble(item,"interest");
iguana_outptset(myinfo,coin,&unspents[max++],jbits256(item,"txid"),jint(item,"vout"),value,spendscriptstr);
avail += value;
}
if ( unspents == 0 )
return(0);
num = max;
printf("avail %.8f interests %.8f satoshis %.8f, txfee %.8f vin0.scriptlen %d\n",dstr(avail),dstr(interests),dstr(satoshis),dstr(txfee),unspents[0].spendlen);
if ( txobj != 0 && avail >= satoshis+txfee )
{
if ( (vins= iguana_RTinputsjson(myinfo,coin,&total,satoshis + txfee,unspents,num,maxmode)) != 0 )
{
if ( total < (satoshis + txfee) )
{
free_json(vins);
free(unspents);
printf("insufficient total %.8f vs (%.8f + %.8f)\n",dstr(total),dstr(satoshis),dstr(txfee));
return(0);
}
total += interests;
if ( (change= (total - (satoshis + txfee))) > 10000 && (changeaddr == 0 || changeaddr[0] == 0) )
{
printf("no changeaddr for %.8f\n",dstr(change));
free_json(vins);
free(unspents);
return(0);
}
iguana_createvins(myinfo,coin,txobj,vins);
if ( change > 10000 )
{
if ( iguana_addressvalidate(coin,&addrtype,changeaddr) < 0 )
{
free_json(vins);
free(unspents);
printf("illegal destination address.(%s)\n",changeaddr);
return(0);
}
bitcoin_addr2rmd160(&addrtype,rmd160,changeaddr);
spendlen = bitcoin_standardspend(spendscript,0,rmd160);
bitcoin_txoutput(txobj,spendscript,spendlen,change);
}
if ( vins != 0 && V == 0 )
{
V = calloc(cJSON_GetArraySize(vins),sizeof(*V)), allocflag = 1;
//iguana_vinprivkeys(myinfo,coin,V,vins);
}
rawtx = bitcoin_json2hex(myinfo,coin,&txid,txobj,V);
if ( allocflag != 0 )
free(V);
}
}
free(unspents);
*vinsp = vins;
return(rawtx);
}
void iguana_RTunspentslock(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *vins)
{
struct iguana_outpoint spentpt; char coinaddr[64]; int32_t i,RTspentflag,num,spentheight,lockedflag;
@ -565,7 +639,7 @@ char *sendtoaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *
jaddnum(valsobj,"basilisktag",basilisktag);
jaddnum(valsobj,"locktime",locktime);
jaddnum(valsobj,"timeout",30000);
if ( 0 && comment != 0 && is_hexstr(comment,0) > 0 )
if ( (0) && comment != 0 && is_hexstr(comment,0) > 0 )
jaddstr(valsobj,"opreturn",comment);
if ( (retstr= basilisk_bitcoinrawtx(myinfo,coin,remoteaddr,basilisktag,jint(valsobj,"timeout"),valsobj,V)) != 0 )
{
@ -981,6 +1055,7 @@ HASH_AND_INT(bitcoinrpc,getrawtransaction,txid,verbose)
if ( coin->notarychain >= 0 && coin->FULLNODE == 0 )
return(_dex_getrawtransaction(myinfo,coin->symbol,txid));
HASH_FIND(hh,coin->RTdataset,txid.bytes,sizeof(txid),RTptr);
memset(checktxid.bytes,0,sizeof(checktxid));
if ( RTptr != 0 && RTptr->rawtxbytes != 0 && RTptr->txlen > 0 )
{
checktxid = RTptr->txid;
@ -1069,7 +1144,7 @@ char *iguana_validaterawtx(struct supernet_info *myinfo,struct iguana_info *coin
if ( (txobj= bitcoin_hex2json(coin,coin->blocks.hwmchain.height,&msgtx->txid,msgtx,rawtx,extraspace,extralen,0,0,suppress_pubkeys)) != 0 )
{
//printf("txobj.(%s)\n",jprint(txobj,0));
if ( 0 && (checkstr= bitcoin_json2hex(myinfo,coin,&txid,txobj,0)) != 0 )
if ( (0) && (checkstr= bitcoin_json2hex(myinfo,coin,&txid,txobj,0)) != 0 )
{
// no guarantee byte for byte identical tx is recreated
if ( strcmp(rawtx,checkstr) != 0 )
@ -1082,7 +1157,7 @@ char *iguana_validaterawtx(struct supernet_info *myinfo,struct iguana_info *coin
break;
jaddnum(retjson,"mismatch position",i);
jadd(retjson,"origtx",txobj);
if ( 0 && (txobj= bitcoin_hex2json(coin,coin->blocks.hwmchain.height,&txid,msgtx,checkstr,extraspace,extralen,0,0,suppress_pubkeys)) != 0 )
if ( (0) && (txobj= bitcoin_hex2json(coin,coin->blocks.hwmchain.height,&txid,msgtx,checkstr,extraspace,extralen,0,0,suppress_pubkeys)) != 0 )
jadd(retjson,"checktx",txobj);
free(checkstr);
return(jprint(retjson,1));

12
iguana/iguana_peers.c

@ -594,7 +594,7 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s
}
}
addr->totalsent += len;
if ( 0 && addr->basilisk != 0 )
if ( (0) && addr->basilisk != 0 )
printf("verack.%d (%s) sent.%d bytes to %s\n",addr->msgcounts.verack,cmdstr,len,addr->ipaddr);
return(len);
}
@ -623,7 +623,7 @@ int32_t iguana_queue_send(struct iguana_peer *addr,int32_t delay,uint8_t *serial
packet->embargo.millis += delay;
}
memcpy(packet->serialized,serialized,datalen);
if ( 0 && addr->supernet != 0 )
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);
return(datalen);
@ -1050,7 +1050,7 @@ int32_t iguana_pollsendQ(struct iguana_info *coin,struct iguana_peer *addr)
struct iguana_packet *packet;
if ( (packet= queue_dequeue(&addr->sendQ)) != 0 )
{
if ( 0 && (addr->supernet != 0 || strcmp((char *)&packet->serialized[4],"SuperNET") == 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);
if ( strcmp((char *)&packet->serialized[4],"getdata") == 0 )
{
@ -1385,18 +1385,18 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin,
}
}
//printf(">>>>>>>>>>>>>> finish %s dedicatedloop.%s\n",coin->symbol,addr->ipaddr);
if ( 0 )
if ( (0) )
{
if ( addr->vinsfp != 0 )
fclose(addr->vinsfp), addr->vinsfp = 0;
if ( addr->voutsfp != 0 )
fclose(addr->voutsfp), addr->voutsfp = 0;
fclose(addr->voutsfp), addr->voutsfp = 0;
}
iguana_iAkill(coin,addr,addr->dead != 0);
myfree(buf,bufsize);
//if ( addr->filehash2 != 0 )
// myfree(addr->filehash2,addr->maxfilehash2*sizeof(*addr->filehash2)), addr->filehash2 = 0;
if ( 0 )
if ( (0) )
{
iguana_mempurge(&addr->RAWMEM);
iguana_mempurge(&addr->TXDATA);

61
iguana/iguana_ramchain.c

@ -56,7 +56,7 @@ struct iguana_kvitem *iguana_hashsetPT(struct iguana_ramchain *ramchain,int32_t
printf("fatal alloc errorC in hashset\n");
iguana_exit(0,0);
}
if ( 0 && ramchain->expanded && selector == 'T' )
if ( (0) && ramchain->expanded && selector == 'T' )
printf("hashmem.%p selector.%c added.(%s) itemind.%x ptr.%p\n",ramchain->hashmem,selector,str,itemind,ptr);
if ( selector == 'T' )
HASH_ADD_KEYPTR(hh,ramchain->txids,key,keylen,ptr);
@ -64,14 +64,14 @@ struct iguana_kvitem *iguana_hashsetPT(struct iguana_ramchain *ramchain,int32_t
ptr->hh.itemind = itemind;
//if ( strcmp(str,"0000000000000000000000000000000000000000000000000000000000000000") == 0 )
// printf("added null txid?\n"), getchar();
if ( 0 && ramchain->expanded && selector == 'T' )
if ( (0) && ramchain->expanded && selector == 'T' )
printf("selector.%c added.(%s) itemind.%x ptr.%p tmp.%p\n",selector,str,itemind,ptr,tmp);
if ( itemind == 0 )
{
printf("negative itemind\n");
iguana_exit(0,0);
}
if ( 0 )
if ( (0) )
{
if ( selector == 'T' )
HASH_FIND(hh,ramchain->txids,key,keylen,tmp);
@ -88,7 +88,7 @@ struct iguana_kvitem *iguana_hashsetPT(struct iguana_ramchain *ramchain,int32_t
void iguana_blocksetcounters(struct iguana_info *coin,struct iguana_block *block,struct iguana_ramchain * ramchain)
{
if ( 0 && coin->virtualchain != 0 )
if ( (0) && coin->virtualchain != 0 )
printf("iguana_blocksetcounters.%s 1st txidind.%u <- ht.%d\n",coin->symbol,ramchain->H.txidind,block->height);
block->RO.firsttxidind = ramchain->H.txidind;
block->RO.firstvout = ramchain->H.unspentind;
@ -110,7 +110,7 @@ int32_t iguana_peerfname(struct iguana_info *coin,int32_t *hdrsip,char *dirname,
bp = 0, bundlei = -2;
if ( bits256_nonz(prevhash2) == 0 || (bp= iguana_bundlefind(coin,&bp,&bundlei,prevhash2)) == 0 || bundlei >= coin->chain->bundlesize-1 )
{
if ( 0 && dispflag != 0 )
if ( (0) && dispflag != 0 )
printf("iguana_peerfname %s error finding.(%s) spec.%p bp.%p\n",coin->symbol,bits256_str(str,hash2),bp!=0?bp->speculative:0,bp);
return(-2);
} else bundlei++;
@ -191,7 +191,7 @@ uint32_t iguana_ramchain_addtxid(struct iguana_info *coin,RAMCHAIN_FUNC,bits256
}
else
{
if ( 0 && ramchain->expanded != 0 )
if ( (0) && ramchain->expanded != 0 )
printf("T.%p txidind.%d numvouts.%d numvins.%d\n",T,txidind,numvouts,numvins);
t->txidind = txidind, t->txid = txid, t->numvouts = numvouts, t->numvins = numvins;
t->bundlei = bundlei;
@ -464,7 +464,7 @@ uint32_t iguana_ramchain_addspend(struct iguana_info *coin,RAMCHAIN_FUNC,bits256
{
external = 1;
txidind = ramchain->externalind++;
if ( 0 && ramchain->expanded != 0 )
if ( (0) && ramchain->expanded != 0 )
{ char str[65]; printf("%p X[%d] <- %s\n",X,txidind,bits256_str(str,prev_hash)); }
if ( ramchain->H.ROflag != 0 )
{
@ -580,7 +580,7 @@ uint32_t iguana_ramchain_addspend256(struct iguana_info *coin,struct iguana_peer
} else s->scriptpos = 0;
//else printf("spend256 scriptfpos.%d\n",s->scriptfpos);
char str[65];
if ( 0 && coin->virtualchain != 0 )
if ( (0) && coin->virtualchain != 0 )
printf("W.%p s.%d vout.%d/%d [%d] %s fpos.%u slen.%d\n",s,spendind,s->prevout,prev_vout,bp->hdrsi,bits256_str(str,prev_hash),(uint32_t)s->scriptpos,(int32_t)s->vinscriptlen);
}
return(spendind);
@ -813,7 +813,7 @@ int64_t _iguana_rdata_action(char *fname,FILE *fp,bits256 lhashes[IGUANA_NUMLHAS
//P2 = 0;//iguana_ramchain_offset(fname,rdata,RAMCHAIN_LARG(IGUANA_LHASH_FIRSTSPENDS),fparg,fpos,P2,&offset,(sizeof(struct iguana_pkextra) * numpkinds),srcsize);
A = iguana_ramchain_offset(fname,rdata,RAMCHAIN_LARG(IGUANA_LHASH_ACCOUNTS),fparg,fpos,A,&offset,(sizeof(struct iguana_account) * numpkinds),srcsize);
char str[65];
if ( 0 && X != 0 )
if ( (0) && X != 0 )
printf("%p X[1] -> %s\n",&X[1],bits256_str(str,X[1]));
X = iguana_ramchain_offset(fname,rdata,RAMCHAIN_LARG(IGUANA_LHASH_EXTERNALS),fparg,fpos,X,&offset,(sizeof(bits256) * numexternaltxids),srcsize);
TXbits = iguana_ramchain_offset(fname,rdata,RAMCHAIN_LARG(IGUANA_LHASH_TXBITS),fparg,fpos,TXbits,&offset,hconv_bitlen(txbits),srcsize);
@ -823,7 +823,7 @@ int64_t _iguana_rdata_action(char *fname,FILE *fp,bits256 lhashes[IGUANA_NUMLHAS
{
Ux = destptr, Sx = destptr, P = destptr, A = destptr, X = destptr, TXbits = destptr, PKbits = destptr, Kspace = destptr; //U2 = destptr, P2 = destptr,
U = iguana_ramchain_offset(fname,rdata,RAMCHAIN_LARG(IGUANA_LHASH_UNSPENTS),fparg,fpos,U,&offset,(sizeof(struct iguana_unspent20) * numunspents),srcsize);
if ( 0 && lhashes != 0 )
if ( (0) && lhashes != 0 )
printf("iter.%d lhashes.%p offset.%ld destptr.%p len.%ld fparg.%p fpos.%ld srcsize.%ld\n",iter,RAMCHAIN_LARG(IGUANA_LHASH_SPENDS),(long)offset,destptr,(long)sizeof(struct iguana_spend256) * numspends,fparg,(long)fpos,(long)srcsize);
S = iguana_ramchain_offset(fname,rdata,RAMCHAIN_LARG(IGUANA_LHASH_SPENDS),fparg,fpos,S,&offset,(sizeof(struct iguana_spend256) * numspends),srcsize);
}
@ -871,7 +871,7 @@ int64_t _iguana_rdata_action(char *fname,FILE *fp,bits256 lhashes[IGUANA_NUMLHAS
int64_t iguana_ramchain_action(char *fname,RAMCHAIN_FUNC,FILE *fp,bits256 lhashes[IGUANA_NUMLHASHES],struct iguana_ramchaindata *destdata,uint64_t fpos,struct iguana_ramchaindata *srcdata,int32_t numblocks,int32_t scriptspace,uint8_t zcash)
{
if ( 0 && ramchain->expanded == 0 )
if ( (0) && ramchain->expanded == 0 )
printf("action.%p (%p %p %p) %ld allocated.%ld [%d:%d %d:%d]\n",srcdata,fp,lhashes,destdata,(long)fpos,(long)srcdata->allocsize,srcdata->txsparsebits,srcdata->numtxsparse,srcdata->pksparsebits,srcdata->numpksparse);
return(_iguana_rdata_action(fname,fp,lhashes,destdata,fpos,ramchain->expanded,srcdata->numtxids,srcdata->numunspents,srcdata->numspends,srcdata->numpkinds,srcdata->numexternaltxids,scriptspace,srcdata->txsparsebits,srcdata->numtxsparse,srcdata->pksparsebits,srcdata->numpksparse,srcdata->allocsize,RAMCHAIN_ARG,numblocks,zcash));
}
@ -882,7 +882,7 @@ int64_t iguana_ramchain_size(char *fname,RAMCHAIN_FUNC,int32_t numblocks,int32_t
if ( (rdata= ramchain->H.data) != 0 )
{
allocsize = iguana_ramchain_action(fname,RAMCHAIN_ARG,0,0,0,0,rdata,numblocks,scriptspace,zcash);
if ( 0 && ramchain->expanded != 0 )
if ( (0) && ramchain->expanded != 0 )
printf("%p iguana_ramchain_size.expanded.%d %u: Koffset.%u scriptoffset.%u stacksize.%u stackspace.%u [%u]\n",ramchain,ramchain->expanded,(int32_t)allocsize,(int32_t)rdata->Koffset,(int32_t)ramchain->H.scriptoffset,(int32_t)ramchain->H.stacksize,(int32_t)rdata->stackspace,scriptspace);
}
return(allocsize);
@ -902,7 +902,7 @@ long iguana_ramchain_setsize(char *fname,struct iguana_ramchain *ramchain,struct
rdata->scriptspace = ramchain->H.scriptoffset;
rdata->stackspace = ramchain->H.stacksize;
rdata->allocsize = iguana_ramchain_size(fname,RAMCHAIN_ARG,numblocks,rdata->scriptspace,zcash);
if ( 0 && rdata->scriptspace != 0 )
if ( (0) && rdata->scriptspace != 0 )
printf("iguana_ramchain_setsize: Koffset.%d scriptspace.%d stackspace.%d (scriptoffset.%d stacksize.%d) allocsize.%d\n",(int32_t)rdata->Koffset,(int32_t)rdata->scriptspace,(int32_t)rdata->stackspace,(int32_t)ramchain->H.scriptoffset,(int32_t)ramchain->H.stacksize,(int32_t)rdata->allocsize);
ramchain->datasize = rdata->allocsize;
return((long)rdata->allocsize);
@ -929,7 +929,7 @@ int64_t iguana_ramchain_saveaction(char *fname,RAMCHAIN_FUNC,FILE *fp,struct igu
before = ftell(fp);
iguana_ramchain_action(fname,RAMCHAIN_ARG,fp,0,rdata,0,rdata,numblocks,scriptspace,zcash);
after = ftell(fp);
if ( 0 && ramchain->expanded == 0 )
if ( (0) && ramchain->expanded == 0 )
{
int32_t i; for (i=0; i<scriptspace&&i<25; i++)
printf("%02x",Kspace[i]);
@ -964,7 +964,7 @@ int64_t iguana_ramchain_init(char *fname,struct iguana_ramchain *ramchain,struct
numpkinds = numunspents;
_iguana_rdata_action(fname,0,0,rdata,0,expanded,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,0,0,0,0,0,RAMCHAIN_ARG,numblocks,zcash);
offset += rdata->allocsize;
if ( 0 && expanded != 0 )
if ( (0) && expanded != 0 )
printf("init T.%d U.%d S.%d P.%d X.%d -> %ld\n",numtxids,numunspents,numspends,numpkinds,numexternaltxids,(long)offset);
if ( rdata->allocsize != iguana_ramchain_size(fname,RAMCHAIN_ARG,numblocks,scriptspace,zcash) )
{
@ -997,12 +997,12 @@ int32_t iguana_ramchain_alloc(char *fname,struct iguana_info *coin,struct iguana
memset(ramchain,0,sizeof(*ramchain));
ramchain->height = height;
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);
if ( 0 && ramchain->expanded != 0 )
if ( (0) && ramchain->expanded != 0 )
printf("T.%d U.%d S.%d P.%d X.%d -> %ld\n",numtxids,numunspents,numspends,numpkinds,numexternaltxids,(long)allocsize);
memset(mem,0,sizeof(*mem));
memset(hashmem,0,sizeof(*hashmem));
hashsize = iguana_hashmemsize(numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace);
while ( 0 && (x= (myallocated(0,-1)+hashsize+allocsize + 65536)) > coin->MAXMEM )
while ( (0) && (x= (myallocated(0,-1)+hashsize+allocsize + 65536)) > coin->MAXMEM )
{
char str[65],str2[65]; fprintf(stderr,"ht.%d wait for allocated %s < MAXMEM %s | elapsed %.2f minutes hashsize.%ld allocsize.%ld\n",height,mbstr(str,myallocated(0,-1)+hashsize+allocsize),mbstr(str2,coin->MAXMEM),(double)(time(NULL)-coin->startutc)/60.,(long)hashsize,(long)allocsize);
sleep(13);
@ -1018,7 +1018,7 @@ int32_t iguana_ramchain_alloc(char *fname,struct iguana_info *coin,struct iguana
long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits,bits256 hash2,bits256 prevhash2,int32_t bundlei,struct iguana_bundle *bp,uint8_t zcash)
{
struct iguana_ramchaindata *rdata,tmp; char fname[1024]; long fpos = -1; int32_t hdrsi,checki; FILE *fp;
struct iguana_ramchaindata *rdata,tmp; char fname[1024]; long fpos = -1; int32_t hdrsi,checki = 0; FILE *fp;
if ( (rdata= ramchain->H.data) == 0 )
{
printf("ramchainsave no data ptr\n");
@ -1045,7 +1045,7 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits
iguana_ramchain_lhashes(fname,RAMCHAIN_ARG,rdata,rdata,bp!=0?bp->n:1,ramchain->H.scriptoffset,zcash);
tmp = *rdata;
iguana_ramchain_compact(fname,RAMCHAIN_ARG,&tmp,rdata,bp!=0?bp->n:1,zcash);
if ( 0 && ramchain->expanded != 0 )
if ( (0) && ramchain->expanded != 0 )
printf("compact.%s: Koffset.%d scriptoffset.%d stacksize.%d allocsize.%d\n",fname,(int32_t)rdata->Koffset,ramchain->H.scriptoffset,ramchain->H.stacksize,(int32_t)rdata->allocsize);
if ( fwrite(&tmp,1,sizeof(tmp),fp) != sizeof(tmp) )
{
@ -1346,7 +1346,7 @@ int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramcha
bp->startutxo = bp->utxofinish = (uint32_t)time(NULL);
if ( bp->Xvalid == 0 )
{
if ( 0 && (rand() % 10) == 0 )
if ( (0) && (rand() % 10) == 0 )
printf("[%d] filesize %ld Xspendptr.%p %p num.%d\n",bp->hdrsi,filesize,ramchain->Xspendptr,ramchain->Xspendinds,ramchain->numXspends);
bp->Xvalid = 1;
}
@ -1362,7 +1362,7 @@ int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramcha
ramchain->Xspendinds = 0;
}
}
else if ( 0 && iter == 1 )
else if ( (0) && iter == 1 )
printf("couldnt map.(%s)\n",fname);
}
return(ramchain->numXspends);
@ -1370,7 +1370,7 @@ int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramcha
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)
{
RAMCHAIN_DECLARE; int32_t valid,iter,i,checki,hdrsi; long filesize; void *ptr; char str[65],str2[65],dirstr[65]; struct iguana_block *block; struct iguana_zblockRO zRO; struct iguana_ramchaindata *rdata;
RAMCHAIN_DECLARE; int32_t valid,iter,i,checki,hdrsi; long filesize=0; void *ptr; char str[65],str2[65],dirstr[65]; struct iguana_block *block; struct iguana_zblockRO zRO; struct iguana_ramchaindata *rdata;
/*if ( ramchain->expanded != 0 && (ramchain->sigsfileptr == 0 || ramchain->sigsfilesize == 0) )
{
sprintf(sigsfname,"sigs/%s/%s",coin->symbol,bits256_str(str,hash2));
@ -1423,7 +1423,7 @@ struct iguana_ramchain *_iguana_ramchain_map(struct supernet_info *myinfo,struct
ramchain->expanded = expanded;
ramchain->numblocks = (bp == 0) ? 1 : bp->n;
//printf("ptr.%p exp.%d extra.%d %p mapped P[%d] fpos.%d + %ld -> %ld vs %ld offset.%u:%u stack.%u:%u\n",ptr,expanded,allocextras,rdata,(int32_t)rdata->Poffset,(int32_t)fpos,(long)rdata->allocsize,(long)(fpos + rdata->allocsize),ramchain->filesize,rscriptoffset,rdata->scriptspace,rstacksize,rdata->stackspace);
if ( 0 && bp != 0 )
if ( (0) && bp != 0 )
{
/*blocksRO = (struct iguana_blockRO *)rdata;
for (i=0; i<bp->n; i++)
@ -1637,7 +1637,7 @@ int32_t iguana_ramchain_cmp(struct iguana_ramchain *A,struct iguana_ramchain *B,
int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_ramchain *dest,struct iguana_ramchain *ramchain,struct iguana_bundle *bp,int16_t bundlei)
{
RAMCHAIN_DECLARE; RAMCHAIN_DESTDECLARE; RAMCHAIN_DESTZEROES;
int32_t j,hdrsi,prevout,scriptlen; uint32_t timestamp=0,unspentind,sequenceid,destspendind=0,desttxidind=0; uint16_t fileid; uint64_t scriptpos; int64_t crypto777_payment = 0;
int32_t j,hdrsi,prevout,scriptlen; uint32_t timestamp=0,unspentind,sequenceid=0,destspendind=0,desttxidind=0; uint16_t fileid; uint64_t scriptpos; int64_t crypto777_payment = 0;
bits256 prevhash; uint64_t value; uint8_t type; struct iguana_unspent *u;
struct iguana_txid *tx; struct iguana_ramchaindata *rdata; uint8_t rmd160[20];
//if ( dest != 0 )
@ -1667,7 +1667,7 @@ int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info
{
if ( coin->active == 0 )
return(-1);;
if ( 0 && ramchain->expanded == 0 && dest != 0 )
if ( (0) && ramchain->expanded == 0 && dest != 0 )
printf("ITER [%d] TXID.%d -> dest.%p desttxid.%d dest->hashmem.%p numtxids.%d\n",rdata->height,ramchain->H.txidind,dest,dest!=0?dest->H.txidind:0,dest!=0?dest->hashmem:0,rdata->numtxids);
tx = &T[ramchain->H.txidind];
if ( iguana_ramchain_addtxid(coin,RAMCHAIN_ARG,tx->txid,tx->numvouts,tx->numvins,tx->locktime,tx->version,tx->timestamp,bundlei) == 0 )
@ -1678,7 +1678,7 @@ int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info
if ( dest->expanded != 0 )
iguana_opreturn(myinfo,1,coin,tx->timestamp,bp,0,bp->bundleheight + bundlei,(((uint64_t)bp->hdrsi << 32) | dest->H.unspentind),0,0,0,0);
//char str[65];
if ( 0 && ramchain->expanded == 0 )
if ( (0) && ramchain->expanded == 0 )
printf("ITER [%d] TXID.%d -> dest.%p desttxid.%d dest->hashmem.%p numtxids.%d\n",rdata->height,ramchain->H.txidind,dest,dest!=0?dest->H.txidind:0,dest!=0?dest->hashmem:0,rdata->numtxids);
if ( iguana_ramchain_addtxid(coin,RAMCHAIN_DESTARG,tx->txid,tx->numvouts,tx->numvins,tx->locktime,tx->version,tx->timestamp,bundlei) == 0 )
return(-2);
@ -1689,6 +1689,7 @@ int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info
if ( coin->active == 0 )
return(-1);
fileid = 0;
unspentind = 0;
scriptpos = 0;
scriptlen = 0;
memset(rmd160,0,sizeof(rmd160));
@ -1740,7 +1741,7 @@ int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info
} //else printf("no script\n");*/
if ( (unspentind= iguana_ramchain_addunspent20(coin,0,RAMCHAIN_ARG,value,0,scriptlen,tx->txid,j,type,bp,rmd160)) == 0 )
return(-4);
if ( 0 )
if ( (0) )
{
int32_t i; for (i=0; i<20; i++)
printf("%02x",rmd160[i]);
@ -1839,7 +1840,7 @@ int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info
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)
{
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,subdir,firsti=1,err,flag,bundlei=0; 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);
@ -2028,7 +2029,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;
if ( 0 && bp != 0 )
if ( (0) && bp != 0 )
printf("UNMARK.[%d:%d]\n",bp->hdrsi,i);
if ( block != 0 )
{
@ -2056,7 +2057,7 @@ void iguana_blockunmark(struct iguana_info *coin,struct iguana_block *block,stru
}
if ( deletefile != 0 && block != 0 )
iguana_blockdelete(coin,block->RO.hash2,i);
if ( 0 && coin->RTheight > 0 && height > 0 && height < coin->blocks.hwmchain.height )
if ( (0) && coin->RTheight > 0 && height > 0 && height < coin->blocks.hwmchain.height )
{
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 )

10
iguana/iguana_realtime.c

@ -170,7 +170,7 @@ void iguana_RTcoinaddr(struct iguana_info *coin,struct iguana_RTtxid *RTptr,stru
}
}
//printf("%s %.8f [%.8f - %.8f] -> %.8f\n",coinaddr,dstr(value),dstr(coin->RTcredits),dstr(coin->RTdebits),dstr(coin->histbalance)+dstr(coin->RTcredits)-dstr(coin->RTdebits));
if ( 0 && strcmp("BTC",coin->symbol) != 0 && strcmp("LTC",coin->symbol) != 0 && strcmp("DOGE",coin->symbol) != 0 )
if ( (0) && strcmp("BTC",coin->symbol) != 0 && strcmp("LTC",coin->symbol) != 0 && strcmp("DOGE",coin->symbol) != 0 )
printf("%lld %s %.8f h %.8f, cr %.8f deb %.8f [%.8f] numunspents.%d %p\n",(long long)polarity,coinaddr,dstr(value),dstr(RTaddr->histbalance),dstr(RTaddr->credits),dstr(RTaddr->debits),dstr(RTaddr->credits)-dstr(RTaddr->debits)+dstr(RTaddr->histbalance),RTaddr->numunspents,unspent);
}
@ -352,7 +352,7 @@ struct iguana_RTtxid *iguana_RTtxid_create(struct iguana_info *coin,struct iguan
}
HASH_ADD_KEYPTR(hh,coin->RTdataset,RTptr->txid.bytes,sizeof(RTptr->txid),RTptr);
bits256_str(str,txid);
if ( 0 && strcmp("BTC",coin->symbol) != 0 )
if ( (0) && strcmp("BTC",coin->symbol) != 0 )
printf("%s.%d txid.(%s) vouts.%d vins.%d version.%d lock.%u t.%u %lld\n",coin->symbol,block->height,str,numvouts,numvins,version,locktime,timestamp,(long long)polarity);
}
else if ( RTptr->txn_count != txn_count || RTptr->numvouts != numvouts || RTptr->numvins != numvins )
@ -630,7 +630,7 @@ void *iguana_RTrawdata(struct iguana_info *coin,bits256 hash2,uint8_t *data,int3
return(&ptr[sizeof(*recvlenp) + sizeof(checknumtx)]);
} else printf("checklen.%d vs %d, checknumtx %d vs %d\n",checklen,(int32_t)(filesize - sizeof(checklen) - sizeof(checknumtx)),checknumtx,*numtxp);
}
else if ( 0 )
else if ( (0) )
{
OS_removefile(fname,0);
printf("(%s) removed to suppress errors\n",fname);
@ -701,7 +701,7 @@ int32_t iguana_RTiterate(struct supernet_info *myinfo,struct iguana_info *coin,i
{
num++;
iguana_blockQ("RTiterate",coin,0,-1,block->RO.hash2,1);
if ( 0 && coin->peers != 0 && (n= coin->peers->numranked) > 0 )
if ( (0) && coin->peers != 0 && (n= coin->peers->numranked) > 0 )
{
if ( (addr= coin->peers->ranked[rand() % n]) != 0 )
iguana_sendblockreqPT(coin,addr,0,-1,block->RO.hash2,1);
@ -809,7 +809,7 @@ void iguana_RTnewblock(struct supernet_info *myinfo,struct iguana_info *coin,str
}*/
if ( block->height < coin->firstRTheight || block->height >= coin->firstRTheight+sizeof(coin->RTblocks)/sizeof(*coin->RTblocks) )
{
if ( 0 && coin->firstRTheight > 0 )
if ( (0) && coin->firstRTheight > 0 )
printf("iguana_RTnewblock illegal blockheight.%d\n",block->height);
return;
}

62
iguana/iguana_recv.c

@ -85,7 +85,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
}
if ( checkbp != bp || j != bundlei )
bp = 0, bundlei = -1;
if ( 0 && coin->enableCACHE != 0 && iguana_speculativesearch(coin,&block,hash2) != 0 )
if ( (0) && coin->enableCACHE != 0 && iguana_speculativesearch(coin,&block,hash2) != 0 )
{
if ( block != 0 && block->hdrsi != 0 && block->bundlei != 0 )
{
@ -127,7 +127,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
iguana_send(coin,addr,serialized,len);
if ( block != 0 )
block->issued = addr->pendtime;
if ( 0 && coin->current == bp )
if ( (0) && coin->current == bp )
printf("REQ.(%s) [%d:%d] %s n.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1,addr->ipaddr,addr->pendblocks);
} else printf("MSG_BLOCK null datalen.%d\n",len);
return(len);
@ -267,7 +267,7 @@ int32_t iguana_speculativefind(struct iguana_info *coin,struct iguana_bundle *bp
for (j=numcached=0; j<bp->n; j++)
if ( bp->speculativecache[j] != 0 )
numcached++;
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("cache %s [%d:%d] h.%d s.%d c.%d -> %d\n",bits256_str(str,block->RO.hash2),bp->hdrsi,i,bp->numhashes,bp->numsaved,bp->numcached,numcached);
return(i);
}
@ -326,7 +326,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s
printf("iguana_getblockM: illegal recvlen.%d\n",recvlen);
return;
}
if ( 0 )
if ( (0) )
{
for (i=0; i<txdata->space[0]; i++)
if ( txdata->space[i] != 0 )
@ -356,7 +356,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s
{
printf("got block that doesnt validate? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2));
return;
} else if ( 0 && coin->enableCACHE != 0 )
} else if ( (0) && coin->enableCACHE != 0 )
printf("c.%d v.(%s) %s n%d\n",coin->enableCACHE,bits256_str(str,origtxdata->zblock.RO.hash2),addr->ipaddr,addr->pendblocks);
origtxdata->zblock.txvalid = 1;
if ( fromcache == 0 && coin->virtualchain == 0 && addr != 0 && addr != &coin->internaladdr )
@ -430,7 +430,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s
else
{
iguana_bundletime(coin,bp,bundlei,block,0);
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("recv [%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2));
}
}
@ -462,7 +462,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s
req = iguana_bundlereq(coin,addr,'B',data,copyflag * recvlen);
req->copyflag = 1;
req->H = *H;
if ( 0 && iguana_sethdr(&checkH,coin->chain->netmagic,H->command,req->serializeddata,recvlen) > 0 && memcmp(&checkH,H,sizeof(checkH)) != 0 )
if ( (0) && iguana_sethdr(&checkH,coin->chain->netmagic,H->command,req->serializeddata,recvlen) > 0 && memcmp(&checkH,H,sizeof(checkH)) != 0 )
{
int z;
for (z=0; z<sizeof(checkH); z++)
@ -527,7 +527,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);
if ( 0 && strcmp("BTCD",coin->symbol) == 0 )
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));
}
@ -609,7 +609,7 @@ int32_t iguana_bundlestats_update(struct iguana_info *coin,struct iguana_block *
else
{
iguana_bundletime(coin,bp,bundlei,block,0);
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("recv [%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2));
return(0);
}
@ -648,7 +648,7 @@ struct iguana_bundlereq *iguana_recv_bundlereq(struct iguana_info *coin,struct i
req = iguana_bundlereq(coin,addr,'B',data,copyflag * recvlen);
req->copyflag = 1;
req->H = *H;
if ( 0 && iguana_sethdr(&checkH,coin->chain->netmagic,H->command,req->serializeddata,recvlen) > 0 && memcmp(&checkH,H,sizeof(checkH)) != 0 )
if ( (0) && iguana_sethdr(&checkH,coin->chain->netmagic,H->command,req->serializeddata,recvlen) > 0 && memcmp(&checkH,H,sizeof(checkH)) != 0 )
{
int z;
for (z=0; z<sizeof(checkH); z++)
@ -859,7 +859,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
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);
if ( 0 && bp->hdrsi == 0 && strcmp("SYS",coin->symbol) == 0 )
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 )
{
@ -991,14 +991,14 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi
req = iguana_bundlereq(coin,addr,'S',0,0);
req->hashes = blockhashes, req->n = n;
char str[65];
if ( 0 && n > 2 && addr != 0 )
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);
if ( strcmp("BTC",coin->symbol) != 0 )
{
if ( n > coin->chain->bundlesize )
iguana_sendblockreqPT(coin,addr,0,-1,blockhashes[1],0);
if ( 0 && coin->RTheight > 0 )
if ( (0) && coin->RTheight > 0 )
{
for (i=1; i<num; i++)
iguana_sendblockreqPT(coin,0,0,-1,blockhashes[i],0);
@ -1051,7 +1051,7 @@ uint32_t iguana_allhashcmp(struct supernet_info *myinfo,struct iguana_info *coin
//n = 0;
//if ( bp->hdrsi < coin->MAXBUNDLES || (coin->current != 0 && coin->lastpending != 0 && bp->hdrsi >= coin->current->hdrsi && bp->hdrsi <= coin->lastpending->hdrsi) )
// n = iguana_bundleissuemissing(myinfo,coin,bp,1,3.);
if ( 0 && n > 2 )
if ( (0) && n > 2 )
printf("ALLHASHES FOUND! %d allhashes.%d issued %d\n",bp->bundleheight,coin->allhashes,n);
//if ( bp->queued == 0 )
// iguana_bundleQ(myinfo,coin,bp,bp->n*5 + (rand() % 500));
@ -1105,7 +1105,7 @@ int32_t iguana_bundlehashadd(struct iguana_info *coin,struct iguana_bundle *bp,i
if ( firstflag != 0 && bp->emitfinish == 0 )
{
//block->fpos = -1;
if ( 0 && iguana_ramchainfile(SuperNET_MYINFO(0),coin,0,&blockR,bp,bundlei,block) == 0 )
if ( (0) && iguana_ramchainfile(SuperNET_MYINFO(0),coin,0,&blockR,bp,bundlei,block) == 0 )
{
size = sizeof(blockR);
iguana_ramchain_free(coin,&blockR,1);
@ -1192,7 +1192,7 @@ void iguana_mainchain_clear(struct supernet_info *myinfo,struct iguana_info *coi
return;
}
}
if ( 0 && tmp != mainchain && coin->RTheight > 0 )
if ( (0) && tmp != mainchain && coin->RTheight > 0 )
printf("iguana_mainchain_clear: unexpected mismatch ht.%d vs %d %s\n",tmp->height,mainchain->height,bits256_str(str,tmp->RO.hash2));
}
}
@ -1208,7 +1208,7 @@ int32_t iguana_height_estimate(struct iguana_info *coin,struct iguana_block **ma
if ( tmp->mainchain != 0 && tmp->height >= 0 )
{
char str[65];
if ( 0 && n > 0 && coin->RTheight > 0 )
if ( (0) && n > 0 && coin->RTheight > 0 )
printf("%s M.%d dist.%d -> %d\n",bits256_str(str,block->RO.hash2),tmp->height,n,tmp->height+n);
*mainchainp = tmp;
return(tmp->height + n);
@ -1416,7 +1416,7 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct supernet_info *myinfo,struc
prevhash2 = zblocks[i].RO.hash2;
}
char str[65];
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("i.%d n.%d match.%d blockhdrs.%s hdrsi.%d\n",i,n,match,bits256_str(str,zblocks[0].RO.hash2),firstbp!=0?firstbp->hdrsi:-1);
/*if ( firstbp != 0 && match >= coin->chain->bundlesize-1 )
{
@ -1479,7 +1479,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct supernet_info *myinfo,str
memset(zero.bytes,0,sizeof(zero));
bp = 0, bundlei = -2;
iguana_bundlefind(coin,&bp,&bundlei,blockhashes[1]);
if ( 0 && strcmp("BTCD",coin->symbol) == 0 )//0 && num >= coin->chain->bundlesize )
if ( (0) && strcmp("BTCD",coin->symbol) == 0 )//0 && num >= coin->chain->bundlesize )
printf("blockhashes[%d] %d of %d %s bp.%d[%d]\n",num,bp==0?-1:bp->hdrsi,coin->bundlescount,bits256_str(str,blockhashes[1]),bp==0?-1:bp->bundleheight,bundlei);
if ( num < 2 )
return(req);
@ -1510,7 +1510,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct supernet_info *myinfo,str
iguana_blockQ("recvhash1",coin,0,-1,bp->nextbundlehash2,1);
}
//printf("call allhashes\n");
if ( 0 && bp->hdrsi == coin->bundlescount-1 )
if ( (0) && bp->hdrsi == coin->bundlescount-1 )
iguana_autoextend(myinfo,coin,bp);
if ( iguana_allhashcmp(myinfo,coin,bp,blockhashes,num) > 0 )
return(req);
@ -1567,11 +1567,11 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct supernet_info *myinfo,str
{
blockhashes[0] = bp->hashes[0];
vcalc_sha256(0,allhash.bytes,blockhashes[0].bytes,coin->chain->bundlesize * sizeof(*blockhashes));
if ( 0 && i == starti )
if ( (0) && i == starti )
printf("vcalc.(%s) [%d].(%s)\n",bits256_str(str,allhash),bp->hdrsi,bits256_str(str2,bp->hashes[0]));
if ( bits256_cmp(allhash,bp->allhash) == 0 )
{
if ( 0 && bp->speculative == 0 )
if ( (0) && bp->speculative == 0 )
printf("matched allhashes.[%d]\n",bp->hdrsi);
if ( bp->queued != 0 )
bp->queued = 0;
@ -1655,11 +1655,11 @@ 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);
}
if ( 0 && block != 0 )
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 )
if ( (0) && strcmp("BTCD",coin->symbol) == 0 )
printf("%s received.(%s) %s\n",coin->symbol,bits256_str(str,origblock->RO.hash2),addr->ipaddr);
if ( bp->speculative != 0 && bp->numspec <= bundlei )
{
@ -1730,7 +1730,7 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig
}
} // else printf("RECV MAINCHAIN.%d\n",coin->blocks.hwmchain.height);
}
if ( 0 && time(NULL) > bp->hdrtime+3 && bundlei == 1 && bp != 0 && bp->numhashes < bp->n && strcmp("BTC",coin->symbol) != 0 && bp->speculative == 0 && bp == coin->current )
if ( (0) && time(NULL) > bp->hdrtime+3 && bundlei == 1 && bp != 0 && bp->numhashes < bp->n && strcmp("BTC",coin->symbol) != 0 && bp->speculative == 0 && bp == coin->current )
{
printf("reissue hdrs request for [%d]\n",bp->hdrsi);
bp->hdrtime = (uint32_t)time(NULL);
@ -1916,7 +1916,7 @@ int32_t iguana_reqblocks(struct supernet_info *myinfo,struct iguana_info *coin)
if ( 1 && (rand() % 100000) == 0 )//|| bp->bundleheight > coin->longestchain-coin->chain->bundlesize )
printf("%s %s MAIN.%d t %.3f lag %.3f\n",coin->symbol,bits256_str(str,hash2),coin->blocks.hwmchain.height+1,threshold,lag);
}
if ( 0 && bp != 0 && bundlei < bp->n-1 && (bits256_nonz(bp->hashes[bundlei+1]) != 0 || (bp->speculative != 0 && bits256_nonz(bp->speculative[bundlei+1]) != 0)) )
if ( (0) && bp != 0 && bundlei < bp->n-1 && (bits256_nonz(bp->hashes[bundlei+1]) != 0 || (bp->speculative != 0 && bits256_nonz(bp->speculative[bundlei+1]) != 0)) )
{
int32_t j;
//memset(bp->hashes[bundlei].bytes,0,sizeof(bp->hashes[bundlei]));
@ -2014,7 +2014,7 @@ int32_t iguana_reqhdrs(struct iguana_info *coin)
if ( now > bp->issuetime+lag && now > bp->hdrtime+3 )
{
bp->hdrtime = now;
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("LAG.%d hdrsi.%d numhashes.%d:%d needhdrs.%d qsize.%d zcount.%d\n",(uint32_t)(now-bp->hdrtime),i,bp->numhashes,bp->n,iguana_needhdrs(coin),queue_size(&coin->hdrsQ),coin->zcount);
if ( bp->issuetime == 0 )
coin->numpendings++;
@ -2045,7 +2045,7 @@ int32_t iguana_reqhdrs(struct iguana_info *coin)
}
}
}
if ( 0 && n > 0 )
if ( (0) && n > 0 )
printf("REQ HDRS pending.%d\n",n);
coin->zcount = 0;
}
@ -2062,7 +2062,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle
//getchar();
return(-1);
}
if ( 0 && coin->enableCACHE != 0 && iguana_speculativesearch(coin,&block,hash2) != 0 && block != 0 && block->txvalid != 0 )
if ( (0) && coin->enableCACHE != 0 && iguana_speculativesearch(coin,&block,hash2) != 0 && block != 0 && block->txvalid != 0 )
{
//printf("found valid [%d:%d] in blockQ\n",block!=0?block->hdrsi:-1,block!=0?block->bundlei:-1);
return(0);
@ -2159,7 +2159,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; struct stritem *hashitem;
int32_t bundlei,priority,i,m=0,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);
@ -2193,7 +2193,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
}
if ( bp == 0 || bp->speculative == 0 || bp == coin->current || bp->hdrsi == coin->bundlescount-1 || bp->numhashes < bp->n )
{
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("%s request HDR.(%s) numhashes.%d [%d]\n",addr!=0?addr->ipaddr:"local",hashstr,bp!=0?bp->numhashes:0,bp!=0?bp->hdrsi:-1);
iguana_send(coin,addr,serialized,datalen);
addr->pendhdrs++;

2
iguana/iguana_rpc.c

@ -1144,7 +1144,7 @@ void iguana_rpcloop(void *args)
{
static char *jsonbuf;
uint16_t port; struct supernet_info *myinfo = args; char filetype[128],content_type[128];
int32_t recvlen,flag,bindsock,postflag,contentlen,sock,remains,numsent,jsonflag,hdrsize,len;
int32_t recvlen,flag,bindsock,postflag=0,contentlen,sock,remains,numsent,jsonflag=0,hdrsize,len;
socklen_t clilen; char helpname[512],remoteaddr[64],*buf,*retstr,*space;//,*retbuf; ,n,i,m
struct sockaddr_in cli_addr; uint32_t ipbits,i,size = IGUANA_WIDTH*IGUANA_HEIGHT*16 + 512;
if ( (port= myinfo->argport) == 0 )

11
iguana/iguana_scripts.c

@ -77,6 +77,13 @@ int32_t bitcoin_checklocktimeverify(uint8_t *script,int32_t n,uint32_t locktime)
return(n);
}
int32_t bitcoin_timelockspend(uint8_t *script,int32_t n,uint8_t rmd160[20],uint32_t timestamp)
{
n = bitcoin_checklocktimeverify(script,n,timestamp);
n = bitcoin_standardspend(script,n,rmd160);
return(n);
}
int32_t bitcoin_MofNspendscript(uint8_t p2sh_rmd160[20],uint8_t *script,int32_t n,const struct vin_info *vp)
{
int32_t i,plen;
@ -333,9 +340,9 @@ int32_t _iguana_calcrmd160(struct iguana_info *coin,struct vin_info *vp)
if ( (plen= vp->spendscript[2]+5) != vp->spendlen )
{
return(IGUANA_SCRIPT_STRANGE);
while ( plen < vp->spendlen )
/*while ( plen < vp->spendlen )
if ( vp->spendscript[plen++] != 0x61 ) // nop
return(IGUANA_SCRIPT_STRANGE);
return(IGUANA_SCRIPT_STRANGE);*/
}
return(IGUANA_SCRIPT_76A988AC);
}

6
iguana/iguana_secp.c

@ -655,9 +655,9 @@ int32_t iguana_schnorr_test(void *ctx)
{
sigs[i] = sig64[i];
continue;
for (j=0; j<64; j++)
printf("%02x",sig64[i][j]);
printf(" sig[%d]\n",i);
//for (j=0; j<64; j++)
// printf("%02x",sig64[i][j]);
//printf(" sig[%d]\n",i);
}
for (i=0; i<N; i++)
{

26
iguana/iguana_sign.c

@ -86,7 +86,7 @@ int32_t iguana_vinparse(struct iguana_info *coin,int32_t rwflag,uint8_t *seriali
serialized[len++] = ((p2shlen >> 8) & 0xff);
} else return(-1);
memcpy(&serialized[len],msg->redeemscript,p2shlen), len += p2shlen;
if ( 0 )
if ( (0) )
{
int32_t j;
for (j=0; j<p2shlen; j++)
@ -97,7 +97,7 @@ int32_t iguana_vinparse(struct iguana_info *coin,int32_t rwflag,uint8_t *seriali
}
//printf("sequence starts.%d %08x\n",len,*(int32_t *)&serialized[len]);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->sequence),&msg->sequence);
if ( 0 )
if ( (0) )
{
int32_t i; char str[65];
for (i=0; i<len; i++)
@ -122,7 +122,7 @@ int32_t iguana_voutparse(int32_t rwflag,uint8_t *serialized,struct iguana_msgvou
else if ( msg->pk_scriptlen > 0 )
{
memcpy(&serialized[len],msg->pk_script,msg->pk_scriptlen);
if ( 0 )
if ( (0) )
{
int32_t i;
for (i=0; i<msg->pk_scriptlen; i++)
@ -294,7 +294,7 @@ int32_t iguana_parsevinobj(struct supernet_info *myinfo,struct iguana_info *coin
// continue;
if ( serialized[len + m + siglen - 1] == SIGHASH_ALL )
memcpy(V->signers[i++].sig,&serialized[len + m],siglen);
if ( 0 )
if ( (0) )
{
int32_t j;
for (j=0; j<siglen; j++)
@ -944,7 +944,7 @@ int32_t iguana_msgtx_Vset(struct iguana_info *coin,uint8_t *serialized,int32_t m
}
len += scriptlen;
}
if ( 0 )
if ( (0) )
{
int32_t i; for (i=0; i<len; i++)
printf("%02x",script[i]);
@ -1115,9 +1115,9 @@ void iguana_ensure_privkey(struct supernet_info *myinfo,struct iguana_info *coin
waddr->privkey = privkey;
if ( bitcoin_priv2wif(waddr->wifstr,waddr->privkey,coin->chain->wiftype) > 0 )
{
if ( 0 && waddr->wiftype != coin->chain->wiftype )
if ( (0) && waddr->wiftype != coin->chain->wiftype )
printf("ensurepriv warning: mismatched wiftype %02x != %02x\n",waddr->wiftype,coin->chain->wiftype);
if ( 0 && waddr->addrtype != coin->chain->pubtype )
if ( (0) && waddr->addrtype != coin->chain->pubtype )
printf("ensurepriv warning: mismatched addrtype %02x != %02x\n",waddr->addrtype,coin->chain->pubtype);
}
}
@ -1220,7 +1220,7 @@ cJSON *iguana_pubkeysjson(uint8_t *pubkeyptrs[],int32_t numpubkeys)
cJSON *bitcoin_txinput(struct iguana_info *coin,cJSON *txobj,bits256 txid,int32_t vout,uint32_t sequenceid,uint8_t *spendscript,int32_t spendlen,uint8_t *redeemscript,int32_t p2shlen,uint8_t *pubkeys[],int32_t numpubkeys,uint8_t *sig,int32_t siglen)
{
cJSON *item,*vins; char p2shscriptstr[IGUANA_MAXSCRIPTSIZE*2+1]; uint8_t *script,len;
cJSON *item,*vins; char p2shscriptstr[IGUANA_MAXSCRIPTSIZE*2+1]; uint8_t *script,len=0;
vins = jduplicate(jobj(txobj,"vin"));
jdelete(txobj,"vin");
item = cJSON_CreateObject();
@ -1284,7 +1284,7 @@ cJSON *bitcoin_txoutput(cJSON *txobj,uint8_t *paymentscript,int32_t len,uint64_t
int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLockTime,struct vin_info *V,int32_t numvins)
{
uint8_t script[IGUANA_MAXSCRIPTSIZE],*activescript,savescript[IGUANA_MAXSCRIPTSIZE]; char str[IGUANA_MAXSCRIPTSIZE*2+1]; int32_t vini,scriptlen,activescriptlen,savelen,errs = 0; cJSON *spendscript,*item;
uint8_t script[IGUANA_MAXSCRIPTSIZE],*activescript,savescript[IGUANA_MAXSCRIPTSIZE]; char str[IGUANA_MAXSCRIPTSIZE*2+1]; int32_t vini,scriptlen,activescriptlen,savelen,errs = 0; cJSON *spendscript,*item=0;
for (vini=0; vini<numvins; vini++)
{
savelen = V[vini].spendlen;
@ -1319,7 +1319,7 @@ int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLoc
}
init_hexbytes_noT(str,activescript,activescriptlen);
//printf("activescript.(%s)\n",str);
if ( logarray != 0 )
if ( logarray != 0 && item != 0 )
jaddstr(item,"original",str);
init_hexbytes_noT(str,script,scriptlen);
//printf("reconstructed.(%s)\n",str);
@ -1410,6 +1410,7 @@ int32_t iguana_signrawtransaction(struct supernet_info *myinfo,struct iguana_inf
{
uint8_t *serialized,*serialized2,*serialized3,*serialized4,*extraspace,pubkeys[64][33]; int32_t finalized,i,len,n,z,plen,maxsize,complete = 0,extralen = 65536; char *checkstr,*privkeystr,*signedtx = 0; bits256 privkeys[64],privkey,txid; cJSON *item; cJSON *txobj = 0;
maxsize = 1000000;
memset(privkey.bytes,0,sizeof(privkey));
if ( rawtx != 0 && rawtx[0] != 0 && (len= (int32_t)strlen(rawtx)>>1) < maxsize )
{
serialized = malloc(maxsize);
@ -1421,13 +1422,13 @@ int32_t iguana_signrawtransaction(struct supernet_info *myinfo,struct iguana_inf
decode_hex(serialized,len,rawtx);
if ( (txobj= bitcoin_hex2json(coin,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys)) != 0 )
{
if ( 0 && vins != 0 )
if ( (0) && vins != 0 )
printf("txobj.(%s)\n",jprint(txobj,0));
if ( jobj(txobj,"error") != 0 )
{
printf("txobj.(%s)\n",jprint(txobj,0));
}
if ( 0 && (checkstr= bitcoin_json2hex(myinfo,coin,&txid,txobj,V)) != 0 ) // no guarantee of identical regen
if ( (0) && (checkstr= bitcoin_json2hex(myinfo,coin,&txid,txobj,V)) != 0 ) // no guarantee of identical regen
{
if ( strcmp(rawtx,checkstr) != 0 )
{
@ -1467,6 +1468,7 @@ int32_t iguana_signrawtransaction(struct supernet_info *myinfo,struct iguana_inf
if ( msgtx->vins[i].p2shlen != 0 )
{
char coinaddr[64]; uint32_t userdatalen,sigsize,pubkeysize; uint8_t *userdata; int32_t j,k,hashtype,type,flag; struct vin_info mvin,mainvin; bits256 zero;
memset(zero.bytes,0,sizeof(zero));
coinaddr[0] = 0;
sigsize = 0;
flag = (msgtx->vins[i].vinscript[0] == 0);

26
iguana/iguana_spendvectors.c

@ -238,8 +238,8 @@ struct iguana_bundle *iguana_fastexternalspent(struct supernet_info *myinfo,stru
int32_t iguana_spendvectors(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,struct iguana_ramchain *ramchain,int32_t starti,int32_t numblocks,int32_t convertflag,int32_t iterate)
{
static uint64_t total,emitted;
int32_t iter,spendind,n=0,txidind,errs=0,emit=0,i,j,k; double startmillis; bits256 prevhash;
uint32_t spent_unspentind,spent_pkind,now,starttime; struct iguana_ramchaindata *rdata;
int32_t iter,spendind=0,n=0,txidind,errs=0,emit=0,i,j,k; double startmillis; bits256 prevhash;
uint32_t spent_unspentind=0,spent_pkind,now,starttime; struct iguana_ramchaindata *rdata;
struct iguana_bundle *spentbp; struct iguana_blockRO *B; struct iguana_spendvector *ptr;
struct iguana_unspent *u,*spentU; struct iguana_txid *T; char str[65];
struct iguana_spend *S,*s; //void *fastfind = 0;
@ -270,7 +270,7 @@ int32_t iguana_spendvectors(struct supernet_info *myinfo,struct iguana_info *coi
ptr = mycalloc('x',sizeof(*ptr),n);
total += n;
startmillis = OS_milliseconds();
if ( 0 && strcmp(coin->symbol,"BTC") == 0 )
if ( (0) && strcmp(coin->symbol,"BTC") == 0 )
printf("start UTXOGEN.%d max.%d ptr.%p millis.%.3f\n",bp->bundleheight,n,ptr,startmillis);
starttime = (uint32_t)time(NULL);
iguana_ramchain_prefetch(coin,&bp->ramchain,3);
@ -383,7 +383,7 @@ int32_t iguana_spendvectors(struct supernet_info *myinfo,struct iguana_info *coi
ptr[emit].unspentind = spent_unspentind;
ptr[emit].fromheight = bp->bundleheight + i;
ptr[emit].tmpflag = 1;
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("fromht.%d spends [%d] TMPVECTOR u%d s%u\n",ptr[emit].fromheight,ptr[emit].hdrsi,ptr[emit].unspentind,spendind);
emit++;
}
@ -436,7 +436,7 @@ int32_t iguana_spendvectors(struct supernet_info *myinfo,struct iguana_info *coi
//printf("ALLOC tmpspends.[%d]\n",bp->hdrsi);
ptr = 0;
}
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("spendvectors.[%d]: tmpspends.%p[%d] after += emit.%d X.%p\n",bp->hdrsi,bp->tmpspends,bp->numtmpspends,emit,bp->ramchain.Xspendinds);
} else errs = -iguana_spendvectorsave(coin,bp,ramchain,ptr!=0?ptr:bp->tmpspends,emit,n);
}
@ -486,12 +486,12 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig
spendind = B[starti].firstvin;
unspentind = B[starti].firstvout;
emit = startemit;
if ( 0 && (coin->RTheight == 0 || bp->bundleheight+bp->n < coin->RTheight) )
if ( (0) && (coin->RTheight == 0 || bp->bundleheight+bp->n < coin->RTheight) )
fprintf(stderr,"BALANCEGEN.[%d] %p[%d] starti.%d s%d <-> endi.%d s%d startemit.%d\n",bp->hdrsi,Xspendinds,numXspends,starti,spendind,endi,B[endi].firstvin+B[endi].numvins,startemit);
for (i=starti; i<=endi; i++)
{
now = (uint32_t)time(NULL);
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("hdrs.[%d] B[%d] 1st txidind.%d txn_count.%d firstvin.%d firstvout.%d\n",bp->hdrsi,i,B[i].firsttxidind,B[i].txn_count,B[i].firstvin,B[i].firstvout);
if ( txidind != B[i].firsttxidind || spendind != B[i].firstvin || unspentind != B[i].firstvout )
{
@ -506,7 +506,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig
printf("balancegen: txidind %u != %u T[txidind].firsttxidind || spendind %u != %u T[txidind].firstvin errs.%d (%d %d)\n",txidind,(uint32_t)T[txidind].txidind,spendind,(uint32_t)T[txidind].firstvin,errs,unspentind,B[i].firstvout);
return(-1);
}
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("starti.%d txidind.%d txi.%d numvins.%d spendind.%d\n",i,txidind,j,T[txidind].numvins,spendind);
/*if ( bp == coin->current )//ramchain == &coin->RTramchain )
{
@ -541,7 +541,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig
spent_hdrsi = spend->hdrsi;
h = spend->fromheight;
}
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("external prevout.%d (emit.%d numX.%d) %p u%d p%d errs.%d spent_hdrsi.%d s%u\n",s->prevout,emit,numXspends,Xspendinds,spent_unspentind,spent_pkind,errs,spent_hdrsi,spendind);
}
else if ( s->prevout >= 0 )
@ -567,7 +567,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig
spentbp = 0;
if ( (spentbp= coin->bundles[spent_hdrsi]) != 0 && spent_unspentind > 0 && spent_pkind > 0 )
{
if ( 0 && bp == coin->current )
if ( (0) && bp == coin->current )
printf("[%d] spendind.%u -> [%d] u%d\n",bp->hdrsi,spendind,spent_hdrsi,spent_unspentind);
if ( iguana_volatileupdate(coin,incremental,&spentbp->ramchain,spent_hdrsi,spent_unspentind,spent_pkind,spent_value,spendind,h) < 0 ) //(spentbp == coin->current) ? &coin->RTramchain :
errs++;
@ -967,7 +967,7 @@ int32_t iguana_balanceflush(struct supernet_info *myinfo,struct iguana_info *coi
}
char str[65]; printf("BALANCES WRITTEN for %d orig.%d bundles %s\n",coin->balanceswritten,coin->origbalanceswritten,bits256_str(str,coin->balancehash));
//iguana_utxoaddr_gen(myinfo,coin,(coin->balanceswritten - 1) * coin->chain->bundlesize);
if ( 0 && coin->balanceswritten > coin->origbalanceswritten+10 ) // strcmp(coin->symbol,"BTC") == 0 &&
if ( (0) && coin->balanceswritten > coin->origbalanceswritten+10 ) // strcmp(coin->symbol,"BTC") == 0 &&
{
coin->active = 0;
coin->started = 0;
@ -1119,7 +1119,7 @@ int32_t iguana_convert(struct iguana_info *coin,int32_t helperid,struct iguana_b
total[helperid % max] += converted;
for (i=sum=0; i<max; i++)
sum += total[i];
if ( 0 && converted != 0 && bp != coin->current )
if ( (0) && converted != 0 && bp != coin->current )
printf("[%4d] millis %7.3f converted.%-7d balance calc.%-4d of %4d | total.%llu of %llu depth.%d\n",bp->hdrsi,OS_milliseconds()-startmillis,converted,m,n,(long long)sum,(long long)total_tmpspends,(int32_t)depth);
}
depth--;
@ -1134,7 +1134,7 @@ int32_t iguana_bundlevalidate(struct supernet_info *myinfo,struct iguana_info *c
if ( coin->chain->zcash != 0 )
{
static uint32_t counter;
if ( 0 && counter++ < 3 )
if ( (0) && counter++ < 3 )
printf("need to process joinsplits before can validate.%s\n",coin->symbol);
bp->validated = (uint32_t)time(NULL);
forceflag = 1;

4
iguana/iguana_tx.c

@ -44,7 +44,7 @@ int32_t iguana_scriptdata(struct iguana_info *coin, uint8_t *scriptspace, long f
memcpy(scriptspace,(void *)(fileptr[0] + (uint32_t)scriptpos),scriptlen);
return(retval);
}
else if ( 0 )
else if ( (0) )
{
printf("munmap (%s)\n",fname);
munmap((void *)fileptr[0],fileptr[1]);
@ -350,7 +350,7 @@ int32_t iguana_peerblockrequest(struct supernet_info *myinfo,struct iguana_info
{
addr->lastsent = block->height;
printf("Sendlen.%d block.%d %s to %s\n",total,block->height,bits256_str(str,block->RO.hash2),addr->ipaddr);
if ( 0 )
if ( (0) )
{
struct iguana_txblock txdata; int32_t checklen; static struct OS_memspace RAWMEM;
if ( RAWMEM.ptr == 0 )

22
iguana/iguana_txidfind.c

@ -18,7 +18,7 @@
int32_t iguana_alloctxbits(struct iguana_info *coin,struct iguana_ramchain *ramchain)
{
static int64_t total; struct iguana_ramchaindata *rdata;
if ( 0 && ramchain->txbits == 0 && (rdata= ramchain->H.data) != 0 )
if ( (0) && ramchain->txbits == 0 && (rdata= ramchain->H.data) != 0 )
{
int32_t tlen; uint8_t *TXbits;
TXbits = RAMCHAIN_PTR(rdata,TXoffset);
@ -65,7 +65,7 @@ uint32_t iguana_sparseadd(uint8_t *bits,uint32_t ind,int32_t width,uint32_t tabl
printf("iguana_sparseadd tablesize zero illegal\n");
return(0);
}
if ( 0 && setind == 0 )
if ( (0) && setind == 0 )
{
char str[65];
for (i=n=0; i<tablesize; i++)
@ -88,7 +88,7 @@ uint32_t iguana_sparseadd(uint8_t *bits,uint32_t ind,int32_t width,uint32_t tabl
//if ( setind == 0 )
// ramchain->sparsesearches++;
//else ramchain->sparseadds++;
if ( 0 && (rdata= ramchain->H.data) != 0 && (ramchain->sparsesearches % 1000000) == 0 )
if ( (0) && (rdata= ramchain->H.data) != 0 && (ramchain->sparsesearches % 1000000) == 0 )
printf("[%3d] %7d.[%-2d %8d] %5.3f adds.(%-10ld %10ld) search.(hits.%-10ld %10ld) %5.2f%% max.%ld\n",ramchain->height/rdata->numblocks,ramchain->height,width,tablesize,(double)(ramchain->sparseadditers + ramchain->sparsesearchiters)/(1+ramchain->sparsesearches+ramchain->sparseadds),ramchain->sparseadds,ramchain->sparseadditers,ramchain->sparsehits,ramchain->sparsesearches,100.*(double)ramchain->sparsehits/(1+ramchain->sparsesearches),ramchain->sparsemax+1);
if ( width == 32 )
{
@ -123,7 +123,7 @@ uint32_t iguana_sparseadd(uint8_t *bits,uint32_t ind,int32_t width,uint32_t tabl
else
{
bitoffset = (ind * width);
if ( 0 && setind == 0 )
if ( (0) && setind == 0 )
printf("tablesize.%d width.%d bitoffset.%d\n",tablesize,width,(int32_t)bitoffset);
for (i=0; i<tablesize; i++,ind++,bitoffset+=width)
{
@ -141,7 +141,7 @@ uint32_t iguana_sparseadd(uint8_t *bits,uint32_t ind,int32_t width,uint32_t tabl
{
ptr = &bits[bitoffset >> 3];
modval = (bitoffset & 7);
if ( 0 && setind == 0 )
if ( (0) && setind == 0 )
printf("tablesize.%d width.%d bitoffset.%d modval.%d i.%d\n",tablesize,width,(int32_t)bitoffset,modval,i);
for (x=j=0; j<width; j++,modval++)
{
@ -152,7 +152,7 @@ uint32_t iguana_sparseadd(uint8_t *bits,uint32_t ind,int32_t width,uint32_t tabl
}
}
else x = bits[bitoffset >> 3];
if ( 0 && setind == 0 )
if ( (0) && setind == 0 )
printf("x.%d\n",x);
if ( x == 0 )
{
@ -179,7 +179,7 @@ uint32_t iguana_sparseadd(uint8_t *bits,uint32_t ind,int32_t width,uint32_t tabl
}
}
else bits[bitoffset >> 3] = setind;
if ( 0 )
if ( (0) )
{
for (x=j=0; j<width; j++)
{
@ -317,7 +317,7 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st
//printf("found txidind.%d\n",txidind);
if ( bits256_cmp(txid,T[txidind].txid) == 0 )
{
if ( 0 )
if ( (0) )
{
int32_t j; struct iguana_block *block;
for (j=0; j<bp->n; j++)
@ -395,7 +395,7 @@ int32_t iguana_txidfastfind(struct iguana_info *coin,int32_t *heightp,bits256 tx
}
return(firstvout);
}
else if ( 0 )
else if ( (0) )
{
int32_t k;
for (k=-16; k<0; k++)
@ -497,7 +497,7 @@ uint32_t iguana_fastfindinit(struct iguana_info *coin)
{
fprintf(stderr,".");
sorted = coin->fast[i];
if ( 0 )
if ( (0) )
{
coin->fast[i] = calloc(1,coin->fastsizes[i]);
memcpy(coin->fast[i],sorted,coin->fastsizes[i]);
@ -509,7 +509,7 @@ uint32_t iguana_fastfindinit(struct iguana_info *coin)
if ( (num+1)*16 + tablesize*sizeof(*hashtable) == coin->fastsizes[i] )
{
hashtable = (int32_t *)((long)sorted + (1 + num)*16);
if ( 0 )
if ( (0) )
{
coin->fasttables[i] = calloc(tablesize,sizeof(*hashtable));
memcpy(coin->fasttables[i],hashtable,tablesize * sizeof(*hashtable));

28
iguana/iguana_unspents.c

@ -361,7 +361,7 @@ struct iguana_pkhash *iguana_pkhashfind(struct iguana_info *coin,struct iguana_r
{
if ( (bp= coin->bundles[i]) != 0 )
{
if ( 0 && coin->RTramchain_busy != 0 )
if ( (0) && coin->RTramchain_busy != 0 )
{
printf("iguana_pkhashfind: unexpected access when RTramchain_busy\n");
return(0);
@ -511,10 +511,10 @@ int32_t iguana_RTscanunspents(struct supernet_info *myinfo,struct iguana_info *c
int64_t iguana_RTpkhashbalance(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *array,uint64_t *spentp,struct iguana_outpoint *unspents,int32_t *nump,struct iguana_ramchain *ramchain,struct iguana_pkhash *p,struct iguana_outpoint lastpt,uint8_t rmd160[20],char *coinaddr,uint8_t *pubkey33,int32_t lastheight,int32_t minconf,int32_t maxconf,char *remoteaddr,int32_t includespent)
{
struct iguana_unspent *U; struct iguana_utxo *U2; int32_t firstslot,vout,spentflag,max,uheight,spentheight; uint32_t pkind=0,unspentind; uint64_t spent = 0,checkval,deposits = 0; struct iguana_txid *T; struct iguana_account *A2; struct iguana_outpoint outpt; struct iguana_ramchaindata *rdata = 0; uint64_t RTspend = 0; bits256 txid;
struct iguana_unspent *U; struct iguana_utxo *U2; int32_t firstslot,vout,spentflag,max,uheight,spentheight=0; uint32_t pkind=0,unspentind; uint64_t spent = 0,checkval,deposits = 0; struct iguana_txid *T; struct iguana_account *A2; struct iguana_outpoint outpt; struct iguana_ramchaindata *rdata = 0; uint64_t RTspend = 0; bits256 txid;
max = *nump;
*spentp = *nump = 0;
if ( 0 && coin->RTramchain_busy != 0 )
if ( (0) && coin->RTramchain_busy != 0 )
{
printf("iguana_pkhashbalance: unexpected access when RTramchain_busy\n");
return(0);
@ -599,7 +599,7 @@ int64_t iguana_RTpkhashbalance(struct supernet_info *myinfo,struct iguana_info *
}
unspentind = U2[unspentind].prevunspentind;
}
if ( 0 && llabs((int64_t)spent - (int64_t)checkval - (int64_t)RTspend) > SMALLVAL )
if ( (0) && llabs((int64_t)spent - (int64_t)checkval - (int64_t)RTspend) > SMALLVAL )
printf("spend %s: [%d] deposits %.8f spent %.8f check %.8f (%.8f) vs A2[%u] %.8f\n",lastheight==IGUANA_MAXHEIGHT?"checkerr":"",lastpt.hdrsi,dstr(deposits),dstr(spent),dstr(checkval)+dstr(RTspend),dstr(*spentp),pkind,dstr(A2[pkind].total));
}
(*spentp) = spent;
@ -613,7 +613,7 @@ int32_t iguana_RTpkhasharray(struct supernet_info *myinfo,struct iguana_info *co
int32_t i,n,m,numunspents; uint64_t spent,deposits,netbalance,total; struct iguana_outpoint lastpt; struct iguana_pkhash *p,_p; struct iguana_ramchain *ramchain; struct iguana_bundle *bp;
if ( coin->RTheight == 0 )
return(-1);
if ( 0 && coin->RTramchain_busy != 0 )
if ( (0) && coin->RTramchain_busy != 0 )
{
printf("iguana_pkhasharray: unexpected access when RTramchain_busy\n");
return(-1);
@ -682,7 +682,7 @@ uint64_t iguana_RTunspents(struct supernet_info *myinfo,struct iguana_info *coin
{
uint64_t total=0,sum=0; struct iguana_pkhash *P; uint8_t *addrtypes,*pubkeys; int32_t i,j,numunspents,maxunspents,flag = 0; char coinaddr[64];
//portable_mutex_lock(&coin->RTmutex);
while ( 0 && coin->RTramchain_busy != 0 )
while ( (0) && coin->RTramchain_busy != 0 )
{
fprintf(stderr,"iguana_pkhasharray: %s unexpected access when RTramchain_busy\n",coin->symbol);
sleep(1);
@ -1181,7 +1181,7 @@ cJSON *iguana_RTlistunspent(struct supernet_info *myinfo,struct iguana_info *coi
int32_t iguana_RTunspentslists(struct supernet_info *myinfo,struct iguana_info *coin,uint64_t *totalp,struct iguana_outpoint *unspents,int32_t max,uint64_t required,int32_t minconf,cJSON *addresses,char *remoteaddr)
{
uint64_t sum = 0; int32_t i,n,firstslot,numunspents,numaddrs; uint8_t pubkey[65]; char *coinaddr,*spendscriptstr; struct iguana_outpoint outpt; cJSON *array,*item;
uint64_t sum = 0; int32_t i=0,n,firstslot,numunspents,numaddrs; uint8_t pubkey[65]; char *coinaddr,*spendscriptstr; struct iguana_outpoint outpt; cJSON *array,*item;
*totalp = 0;
numunspents = 0;
if ( (numaddrs= cJSON_GetArraySize(addresses)) == 0 )
@ -1538,7 +1538,7 @@ int32_t iguana_utxoaddr_check(struct supernet_info *myinfo,struct iguana_info *c
sum = 0;
bitcoin_address(coinaddr,utxoaddr->p2sh == 0 ? coin->chain->pubtype : coin->chain->p2shtype,utxoaddr->rmd160,sizeof(utxoaddr->rmd160));
numunspents += iguana_RTaddr_unspents(myinfo,coin,&sum,&unspents[numunspents],max-numunspents,coinaddr,0,lastheight,0);
if ( 0 && utxoaddr->histbalance != 0 && strcmp(coin->symbol,"BTCD") == 0 )
if ( (0) && utxoaddr->histbalance != 0 && strcmp(coin->symbol,"BTCD") == 0 )
{
total += utxoaddr->histbalance;
//printf("fiat/revs sendtoaddress %s %.8f # total %.8f\n",coinaddr,dstr(utxoaddr->histbalance),dstr(total));
@ -1554,7 +1554,7 @@ int32_t iguana_utxoaddr_check(struct supernet_info *myinfo,struct iguana_info *c
flag = 1;
//break;
}
if ( 0 && flag == 0 )//sum != utxoaddr->histbalance || checkbalance != sum )
if ( (0) && flag == 0 )//sum != utxoaddr->histbalance || checkbalance != sum )
{
bad++;
for (i=0; i<numunspents; i++)
@ -1624,7 +1624,7 @@ uint64_t iguana_RTstart(struct supernet_info *myinfo,struct iguana_info *coin,in
uint64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *coin,int32_t maxheight)
{
char fname[1024],fname2[1024],coinaddr[64],str[65],checkaddr[64]; struct iguana_utxoaddr *utxoaddr,UA,*tmp,*last=0; uint16_t hdrsi; uint8_t *table,item[UTXOADDR_ITEMSIZE]; uint32_t *counts,*offsets,offset,n; int32_t total,errs=0,height=0,j,k,ind,tablesize=0; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata=0; uint64_t checkbalance=0,balance = 0;
char fname[1024],fname2[1024],coinaddr[64],str[65],checkaddr[64]; struct iguana_utxoaddr *utxoaddr,UA,*tmp,*last=0; uint16_t hdrsi; uint8_t *table,item[UTXOADDR_ITEMSIZE]; uint32_t *counts,*offsets,offset,n; int32_t total,errs=0,height=0,ind,tablesize=0; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata=0; uint64_t checkbalance=0,balance = 0;
for (hdrsi=0; hdrsi<coin->bundlescount-1; hdrsi++)
{
if ( (bp= coin->bundles[hdrsi]) != 0 && bp->bundleheight < maxheight )
@ -1633,7 +1633,7 @@ uint64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *co
sprintf(fname2,"%s/%s/utxoaddrs.%d",GLOBAL_DBDIR,coin->symbol,height), OS_portable_path(fname2);
if ( iguana_utxoaddr_map(coin,fname2) != 0 )
{
if ( 0 && strcmp("BTCD",coin->symbol) == 0 )
if ( (0) && strcmp("BTCD",coin->symbol) == 0 )
errs = iguana_utxoaddr_validate(myinfo,coin,height);
printf("nogen %s HIST BALANCE %s %.8f errs %d\n",fname2,bits256_str(str,coin->utxoaddrhash),dstr(coin->histbalance),errs);
if ( errs == 0 && coin->histbalance > 0 && height > 0 )
@ -1731,14 +1731,14 @@ uint64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *co
{
qsort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp);
continue;
for (j=0; j<counts[ind]; j++)
/*for (j=0; j<counts[ind]; j++)
{
iguana_rwutxoaddr(0,ind,&table[(offsets[ind]+j) * UTXOADDR_ITEMSIZE],&UA);
for (k=0; k<20; k++)
printf("%02x",UA.rmd160[k]);
bitcoin_address(coinaddr,coin->chain->pubtype,UA.rmd160,sizeof(UA.rmd160));
//printf(" [%4d] p%-5d %12.8f ind.%04x %d %s\n",UA.hdrsi,UA.pkind,dstr(UA.histbalance),ind,j,coinaddr);
}
}*/
}
}
if ( iguana_utxoaddr_save(coin,fname,balance,counts,offsets,table) == 0 )
@ -1762,7 +1762,7 @@ uint64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *co
{
printf("validating %s HIST BALANCE %s %.8f errs %d\n",fname2,bits256_str(str,coin->utxoaddrhash),dstr(coin->histbalance),errs);
errs = 0;
if ( 0 && strcmp("BTCD",coin->symbol) == 0 )
if ( (0) && strcmp("BTCD",coin->symbol) == 0 )
errs = iguana_utxoaddr_validate(myinfo,coin,height);
printf("gen %s HIST BALANCE %s %.8f errs %d\n",fname2,bits256_str(str,coin->utxoaddrhash),dstr(coin->histbalance),errs);
if ( errs != 0 || height == 0 )

2
iguana/iguana_volatiles.c

@ -290,7 +290,7 @@ int32_t iguana_volatileupdate(struct iguana_info *coin,int32_t incremental,struc
utxo = &spentchain->Uextras[spent_unspentind];
if ( utxo->spentflag == 0 )
{
if ( 0 && fromheight/coin->chain->bundlesize >= coin->current->hdrsi )
if ( (0) && fromheight/coin->chain->bundlesize >= coin->current->hdrsi )
printf("iguana_volatileupdate.%d: [%d] spent.(u%u %.8f pkind.%d) fromht.%d [%d] spendind.%d\n",incremental,spent_hdrsi,spent_unspentind,dstr(spent_value),spent_pkind,fromheight,fromheight/coin->chain->bundlesize,spendind);
utxo->prevunspentind = A2[spent_pkind].lastunspentind;
utxo->spendind = spendind;

4
iguana/iguana_wallet.c

@ -818,7 +818,7 @@ cJSON *iguana_walletiterate(struct supernet_info *myinfo,struct iguana_info *coi
}
printf("persistent address not found in wallet, autoadd.(%s)\n",coinaddr);
}
else if ( persistent_flag != 0 && 0 )
else if ( persistent_flag != 0 && (0) )
printf("found persistent address in wallet\n");
}
portable_mutex_unlock(&myinfo->bu_mutex);
@ -1593,7 +1593,7 @@ STRING_ARG(bitcoinrpc,dumpwallet,filename)
{
if ( (walletobj= jobj(strobj,"wallet")) != 0 )
jadd(retjson,"wallet",jduplicate(walletobj));
if ( 0 && (walletobj= iguana_walletjson(myinfo)) != 0 )
if ( (0) && (walletobj= iguana_walletjson(myinfo)) != 0 )
jadd(retjson,"memory",walletobj);
free_json(strobj);
}

6
iguana/kmd_lookup.h

@ -231,7 +231,7 @@ FILE *kmd_txidinit(struct iguana_info *coin)
}
} else break;
}
printf("finished txidinit fpos %ld vs lastpos %ld\n",ftell(fp),lastpos);
printf("%s finished txidinit fpos %ld vs lastpos %ld\n",coin->symbol,ftell(fp),lastpos);
fseek(fp,lastpos,SEEK_SET);
} else fp = fopen(fname,"wb+");
return(fp);
@ -264,7 +264,7 @@ FILE *kmd_spendinit(struct iguana_info *coin)
else break;
} else break;
}
printf("finished spendinit fpos %ld vs lastpos %ld\n",ftell(fp),lastpos);
printf("%s finished spendinit fpos %ld vs lastpos %ld\n",coin->symbol,ftell(fp),lastpos);
fseek(fp,lastpos,SEEK_SET);
HASH_ITER(hh,coin->kmd_transactions,ptr,tmp)
{
@ -723,7 +723,7 @@ void kmd_bitcoinscan()
{
if ( (coin= iguana_coinfind(jstri(array,i))) != 0 && strcmp(coin->symbol,"BTC") != 0 )
{
if ( strcmp("KMD",coin->symbol) == 0 )
//if ( strcmp("KMD",coin->symbol) == 0 )
_kmd_bitcoinscan(coin);
}
}

18
iguana/main.c

@ -543,7 +543,7 @@ void iguana_appletests(struct supernet_info *myinfo)
{
char *str;
//iguana_chaingenesis(1,1403138561,0x1e0fffff,8359109,bits256_conv("fd1751cc6963d88feca94c0d01da8883852647a37a0a67ce254d62dd8c9d5b2b")); // BTCD
if ( 0 )
if ( (0) )
{
char genesisblock[1024];
//iguana_chaingenesis("VPN",0,bits256_conv("00000ac7d764e7119da60d3c832b1d4458da9bc9ef9d5dd0d91a15f690a46d99"),genesisblock,"scrypt",1,1409839200,0x1e0fffff,64881664,bits256_conv("698a93a1cacd495a7a4fb3864ad8d06ed4421dedbc57f9aaad733ea53b1b5828")); // VPN
@ -571,13 +571,13 @@ void iguana_appletests(struct supernet_info *myinfo)
bitcoin_sharedsecret(myinfo->ctx,hash2,pubkey,33);
printf("secp256k1 elapsed %.3f for %d iterations\n",OS_milliseconds() - startmillis,i);
getchar();**/
if ( 0 && (str= SuperNET_JSON(myinfo,iguana_coinfind("BTCD"),cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":512,\"endpend\":512,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
if ( (0) && (str= SuperNET_JSON(myinfo,iguana_coinfind("BTCD"),cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":512,\"endpend\":512,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( 1 && (str= SuperNET_JSON(myinfo,iguana_coinfind("BTC"),cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":8,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( 0 && (str= SuperNET_JSON(myinfo,iguana_coinfind("BTCD"),cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"alice\",\"password\":\"alice\",\"passphrase\":\"alice\"}"),0,myinfo->rpcport)) != 0 )
if ( (0) && (str= SuperNET_JSON(myinfo,iguana_coinfind("BTCD"),cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"alice\",\"password\":\"alice\",\"passphrase\":\"alice\"}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( (str= SuperNET_JSON(myinfo,iguana_coinfind("BTCD"),cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"bob\",\"password\":\"bob\",\"passphrase\":\"bob\"}"),0,myinfo->rpcport)) != 0 )
@ -641,7 +641,7 @@ int32_t iguana_commandline(struct supernet_info *myinfo,char *arg)
free(str);
}
free_json(argjson);
if ( 0 )
if ( (0) )
{
uint32_t buf[81],c;
OS_randombytes((void *)buf,sizeof(buf));
@ -1612,7 +1612,7 @@ void komodo_ICO_batch(cJSON *array,int32_t batchid)
printf("# %s KMD %.8f\n",coinaddr,dstr(kmdamount));
if ( (iter & 1) == 0 )
{
if ( 1 )
if ( (0) )
{
printf("curl --url \"http://127.0.0.1:7778\" --data \"{\\\"agent\\\":\\\"dex\\\",\\\"method\\\":\\\"importaddress\\\",\\\"address\\\":\\\"%s\\\",\\\"symbol\\\":\\\"KMD\\\"}\" # %.8f\n",coinaddr,dstr(kmdamount));
printf("sleep 3\n");
@ -1676,9 +1676,9 @@ void iguana_main(void *arg)
else printf("ENDIAN ERROR\n");
mycalloc(0,0,0);
#ifdef __APPLE__
char *batchstr,*batchstr2; cJSON *batchjson; long batchsize; char fname[512],fname2[512]; int32_t batchid = 9;
char *batchstr,*batchstr2; cJSON *batchjson; long batchsize; char fname[512],fname2[512]; int32_t batchid = 10;
sprintf(fname,"REVS.raw"), sprintf(fname2,"REVS.rawtxids");
if ( 0 && (batchstr= OS_filestr(&batchsize,fname)) != 0 && (batchstr2= OS_filestr(&batchsize,fname2)) != 0 )
if ( (0) && (batchstr= OS_filestr(&batchsize,fname)) != 0 && (batchstr2= OS_filestr(&batchsize,fname2)) != 0 )
{
komodo_REVS_merge(batchstr,batchstr2);
}
@ -1763,7 +1763,7 @@ void iguana_main(void *arg)
{
basilisks_init(myinfo);
}
if ( 0 )
if ( (0) )
{
char *jsonstr = "[\"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828\", \"02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344\", \"03750cf30d739cd7632f77c1c02812dd7a7181628b0558058d4755838117e05339\", \"0394f3529d2e8cc69ffa7a2b55f3761e7be978fa1896ef4c55dc9c275e77e5bf5e\", \"0243c1eeb3777af47187d542e5f8c84f0ac4b05cf5a7ad77faa8cb6d2d56db7823\", \"02bb298844175640a34e908ffdfa2839f77aba3d5edadefee16beb107826e00063\", \"02fa88e549b4b871498f892e527a5d57287916809f8cc3163f641d71c535e8df5a\", \"032f799e370f06476793a122fcd623db7804898fe5aef5572095cfee6353df34bf\", \"02c06fe5401faff4442ef87b7d1b56c2e5a214166615f9a2f2030c71b0cb067ae8\", \"038ac67ca49a8169bcc5de83fe020071095a2c3b2bc4d1c17386977329758956d5\"]";
@ -1785,4 +1785,4 @@ void iguana_main(void *arg)
// features
// komodod convert passphrase to privkey
// Z -> Z
// iguana init nanomsg in own thread
// iguana init nanomsg in own thread

1
iguana/mini-gmp.c

@ -4416,6 +4416,7 @@ void mpz_from_bits256(mpz_t bn,bits256 x)
bits256 mpz_to_bits256(mpz_t bn)
{
bits256 x,rev; size_t count; int32_t i;
memset(x.bytes,0,sizeof(x));
mpz_export(rev.bytes,&count,1,sizeof(uint64_t),1,0,bn);
for (i=0; i<32; i++)
x.bytes[i] = rev.bytes[31-i];

2
iguana/pangea_api.c

@ -530,7 +530,7 @@ char *pangea_hexmsg(struct supernet_info *myinfo,struct gecko_chain *cat,void *d
}
}
}
else if ( 0 )
else if ( (0) )
{
for (i=0; i<datalen; i++)
printf("%02x",serialized[i]);

2
iguana/pangea_hand.c

@ -811,7 +811,7 @@ int32_t pangea_lastman(struct supernet_info *myinfo,struct table_info *tp)
printf("DUPLICATE LASTMAN!\n");
return(1);
}
if ( 0 && tp->priv.myind == activej && tp->priv.automuck == 0 )
if ( (0) && tp->priv.myind == activej && tp->priv.automuck == 0 )
{
pangea_sendcmd(myinfo,tp,"faceup",-1,tp->priv.holecards[0].bytes,sizeof(tp->priv.holecards[0]),tp->priv.cardis[0],tp->priv.cardis[0] != 0xff);
pangea_sendcmd(myinfo,tp,"faceup",-1,tp->priv.holecards[1].bytes,sizeof(tp->priv.holecards[1]),tp->priv.cardis[1],tp->priv.cardis[1] != 0xff);

22
iguana/pangea_json.c

@ -227,6 +227,7 @@ cJSON *pangea_tablestatus(struct supernet_info *myinfo,struct table_info *tp)
jaddi64bits(array,tp->active[i]!=0?tp->active[i]->nxt64bits:0);
jadd(json,"addrs",array);*/
total = 0;
str = "error";
for (iter=0; iter<6; iter++)
{
array = cJSON_CreateArray();
@ -243,22 +244,23 @@ cJSON *pangea_tablestatus(struct supernet_info *myinfo,struct table_info *tp)
case 3: val = p->betstatus; str = "status"; break;
case 4: val = p->bets; str = "bets"; break;
case 5: val = p->won; str = "won"; break;
default: str = "error"; break;
}
}
if ( iter == 5 )
won[i] = val;
else
{
if ( iter == 3 )
jaddistr(array,pangea_statusstr((int32_t)val));
else
{
if ( iter == 4 )
total += val, bets[i] = val;
else if ( iter == 2 )
snapshot[i] = val;
jaddinum(array,val);
}
if ( iter == 3 )
jaddistr(array,pangea_statusstr((int32_t)val));
else
{
if ( iter == 4 )
total += val, bets[i] = val;
else if ( iter == 2 )
snapshot[i] = val;
jaddinum(array,val);
}
}
}
jadd(json,str,array);

2
iguana/ramchain_api.c

@ -82,7 +82,7 @@ STRING_ARG(iguana,removecoin,activecoin)
{
coin->active = 0;
coin->started = 0;
if ( 0 )
if ( (0) )
{
for (i=0; i<IGUANA_MAXPEERS; i++)
{

2
iguana/secp256k1/src/ecmult_const_impl.h

@ -60,7 +60,7 @@ static int secp256k1_wnaf_const(int *wnaf, secp256k1_scalar s, int w) {
int word = 0;
/* 1 2 3 */
int u_last;
int u;
int u=0;
#ifdef USE_ENDOMORPHISM
int flip;

2
iguana/secp256k1/src/modules/rangeproof/rangeproof_impl.h

@ -406,7 +406,7 @@ SECP256K1_INLINE static void secp256k1_rangeproof_ch32xor(unsigned char *x, cons
SECP256K1_INLINE static int secp256k1_rangeproof_rewind_inner(secp256k1_scalar *blind,uint64_t *v,
unsigned char *message,int *mlen,secp256k1_scalar *ev,secp256k1_scalar *s,int *rsizes,int rings, const unsigned char *nonce,const unsigned char *commit,const unsigned char *proof,int len)
{
unsigned char prep[4096]; unsigned char tmp[32]; uint64_t value; int offset,i,j,b,skip1,skip2,npub;
unsigned char prep[4096]; unsigned char tmp[32]; uint64_t value=0; int offset,i,j,b,skip1,skip2,npub;
secp256k1_scalar s_orig[128]; secp256k1_scalar sec[32]; secp256k1_scalar stmp;
npub = ((rings - 1) << 2) + rsizes[rings-1];
VERIFY_CHECK(npub <= 128);

2
iguana/secp256k1/src/modules/recovery/main_impl.h

@ -123,7 +123,7 @@ static int secp256k1_ecdsa_sig_recover(const secp256k1_ecmult_context *ctx, cons
int secp256k1_ecdsa_sign_recoverable(const secp256k1_context* ctx, secp256k1_ecdsa_recoverable_signature *signature, const unsigned char *msg32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void* noncedata) {
secp256k1_scalar r, s;
secp256k1_scalar sec, non, msg;
int recid;
int recid = 0;
int ret = 0;
int overflow = 0;
VERIFY_CHECK(ctx != NULL);

253
iguana/tests/KMD.batch9

@ -0,0 +1,253 @@
# RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL KMD 2225.74637484, REVS 44.17250867
# RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL KMD 2225.74637484
./komodo-cli sendtoaddress RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL 2225.74637484
sleep 3
echo "2225.74637484 <- expected amount RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL"
# RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 KMD 71.93221162, REVS 1.27173666
# RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 KMD 71.93221162
./komodo-cli sendtoaddress RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 71.93221162
sleep 3
echo "71.93221162 <- expected amount RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5"
# RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc KMD 929.58263940
./komodo-cli sendtoaddress RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc 929.58263940
sleep 3
echo "929.58263940 <- expected amount RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc"
# RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb KMD 38642.70360624
./komodo-cli sendtoaddress RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb 38642.70360624
sleep 3
echo "38642.70360624 <- expected amount RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb"
# RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF KMD 338.77820389
./komodo-cli sendtoaddress RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF 338.77820389
sleep 3
echo "338.77820389 <- expected amount RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF"
# RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC KMD 3010.53084291
./komodo-cli sendtoaddress RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC 3010.53084291
sleep 3
echo "3010.53084291 <- expected amount RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC"
# RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy KMD 9683.15249375
./komodo-cli sendtoaddress RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy 9683.15249375
sleep 3
echo "9683.15249375 <- expected amount RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy"
# RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1 KMD 1318.49290289
./komodo-cli sendtoaddress RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1 1318.49290289
sleep 3
echo "1318.49290289 <- expected amount RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1"
# RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC KMD 1696.59450723
./komodo-cli sendtoaddress RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC 1696.59450723
sleep 3
echo "1696.59450723 <- expected amount RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC"
# RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4 KMD 9294.89681136
./komodo-cli sendtoaddress RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4 9294.89681136
sleep 3
echo "9294.89681136 <- expected amount RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4"
# RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN KMD 3873.26099750
./komodo-cli sendtoaddress RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN 3873.26099750
sleep 3
echo "3873.26099750 <- expected amount RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN"
# RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX KMD 48410.92089250
./komodo-cli sendtoaddress RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX 48410.92089250
sleep 3
echo "48410.92089250 <- expected amount RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX"
# REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg KMD 24342.54200516
./komodo-cli sendtoaddress REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg 24342.54200516
sleep 3
echo "24342.54200516 <- expected amount REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg"
# RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy KMD 224445.72348323
./komodo-cli sendtoaddress RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy 224445.72348323
sleep 3
echo "224445.72348323 <- expected amount RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy"
# RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u KMD 4163.75557231
./komodo-cli sendtoaddress RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u 4163.75557231
sleep 3
echo "4163.75557231 <- expected amount RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u"
# RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW KMD 1060.11153500
./komodo-cli sendtoaddress RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW 1060.11153500
sleep 3
echo "1060.11153500 <- expected amount RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW"
# RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM KMD 5526.71509918
./komodo-cli sendtoaddress RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM 5526.71509918
sleep 3
echo "5526.71509918 <- expected amount RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM"
# RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb KMD 163809.81597006, REVS 3251.55110000
# RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb KMD 163809.81597006
./komodo-cli sendtoaddress RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb 163809.81597006
sleep 3
echo "163809.81597006 <- expected amount RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb"
# RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN KMD 968.31524937
./komodo-cli sendtoaddress RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN 968.31524937
sleep 3
echo "968.31524937 <- expected amount RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN"
# RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq KMD 4785.58282591, REVS 2.73080820
# RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq KMD 4785.58282591
./komodo-cli sendtoaddress RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq 4785.58282591
sleep 3
echo "4785.58282591 <- expected amount RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq"
# REALH3GPjNeVt3q9URisFKKCvjZd6NQcid KMD 631.99999696
./komodo-cli sendtoaddress REALH3GPjNeVt3q9URisFKKCvjZd6NQcid 631.99999696
sleep 3
echo "631.99999696 <- expected amount REALH3GPjNeVt3q9URisFKKCvjZd6NQcid"
# RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo KMD 2826.51221292
./komodo-cli sendtoaddress RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo 2826.51221292
sleep 3
echo "2826.51221292 <- expected amount RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo"
# RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q KMD 14524.72874062
./komodo-cli sendtoaddress RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q 14524.72874062
sleep 3
echo "14524.72874062 <- expected amount RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q"
# RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj KMD 112939.81142424, REVS 2241.80390030
# RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj KMD 112939.81142424
./komodo-cli sendtoaddress RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj 112939.81142424
sleep 3
echo "112939.81142424 <- expected amount RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj"
# RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v KMD 813.38480947
./komodo-cli sendtoaddress RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v 813.38480947
sleep 3
echo "813.38480947 <- expected amount RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v"
# RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM KMD 6777.23843037
./komodo-cli sendtoaddress RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM 6777.23843037
sleep 3
echo "6777.23843037 <- expected amount RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM"
# RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u KMD 253.57894226
./komodo-cli sendtoaddress RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u 253.57894226
sleep 3
echo "253.57894226 <- expected amount RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u"
# RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7 KMD 4841.57624687
./komodo-cli sendtoaddress RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7 4841.57624687
sleep 3
echo "4841.57624687 <- expected amount RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7"
# RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU KMD 1788.59446342
./komodo-cli sendtoaddress RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU 1788.59446342
sleep 3
echo "1788.59446342 <- expected amount RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU"
# RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u KMD 4840.60793162
./komodo-cli sendtoaddress RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u 4840.60793162
sleep 3
echo "4840.60793162 <- expected amount RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u"
# RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj KMD 21334.16787115
./komodo-cli sendtoaddress RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj 21334.16787115
sleep 3
echo "21334.16787115 <- expected amount RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj"
# REBRXGotFX5fojy22CFEzq88EbbZux9CjM KMD 2075.39004188
./komodo-cli sendtoaddress REBRXGotFX5fojy22CFEzq88EbbZux9CjM 2075.39004188
sleep 3
echo "2075.39004188 <- expected amount REBRXGotFX5fojy22CFEzq88EbbZux9CjM"
# RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD KMD 7111.30719141
./komodo-cli sendtoaddress RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD 7111.30719141
sleep 3
echo "7111.30719141 <- expected amount RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD"
# REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m KMD 142057.63342296
./komodo-cli sendtoaddress REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m 142057.63342296
sleep 3
echo "142057.63342296 <- expected amount REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m"
# RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK KMD 27999.94713904
./komodo-cli sendtoaddress RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK 27999.94713904
sleep 3
echo "27999.94713904 <- expected amount RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK"
# RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb KMD 2026.68381694
./komodo-cli sendtoaddress RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb 2026.68381694
sleep 3
echo "2026.68381694 <- expected amount RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb"
# RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz KMD 264.96107994
./komodo-cli sendtoaddress RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz 264.96107994
sleep 3
echo "264.96107994 <- expected amount RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz"
# RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY KMD 6951.11546870
./komodo-cli sendtoaddress RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY 6951.11546870
sleep 3
echo "6951.11546870 <- expected amount RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY"
# RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq KMD 3325.70020871, REVS 65.95939412
# RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq KMD 3325.70020871
./komodo-cli sendtoaddress RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq 3325.70020871
sleep 3
echo "3325.70020871 <- expected amount RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq"
# RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP KMD 773.87754730
./komodo-cli sendtoaddress RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP 773.87754730
sleep 3
echo "773.87754730 <- expected amount RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP"
# RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M KMD 8908.50029425
./komodo-cli sendtoaddress RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M 8908.50029425
sleep 3
echo "8908.50029425 <- expected amount RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M"
# RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD KMD 2802.45988185
./komodo-cli sendtoaddress RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD 2802.45988185
sleep 3
echo "2802.45988185 <- expected amount RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD"
# R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz KMD 27199.08040085
./komodo-cli sendtoaddress R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz 27199.08040085
sleep 3
echo "27199.08040085 <- expected amount R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz"
# RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz KMD 818.43860613
./komodo-cli sendtoaddress RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz 818.43860613
sleep 3
echo "818.43860613 <- expected amount RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz"
# RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN KMD 1544.33012483
./komodo-cli sendtoaddress RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN 1544.33012483
sleep 3
echo "1544.33012483 <- expected amount RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN"
# R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg KMD 30016.80441537
./komodo-cli sendtoaddress R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg 30016.80441537
sleep 3
echo "30016.80441537 <- expected amount R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg"
# RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN KMD 4146.19464926
./komodo-cli sendtoaddress RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN 4146.19464926
sleep 3
echo "4146.19464926 <- expected amount RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN"
# RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut KMD 24089.07982436
./komodo-cli sendtoaddress RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut 24089.07982436
sleep 3
echo "24089.07982436 <- expected amount RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut"
# RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv KMD 693.08132289
./komodo-cli sendtoaddress RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv 693.08132289
sleep 3
echo "693.08132289 <- expected amount RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv"
# total KMD 1012975.94073092 REVS 0.00000000

251
iguana/tests/KMD.batch9.importaddress

@ -0,0 +1,251 @@
# RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL KMD 2225.74637484, REVS 44.17250867
# RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL KMD 2225.74637484
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL\",\"symbol\":\"KMD\"}" # 2225.74637484
sleep 3
echo "2225.74637484 <- expected amount RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL"
# RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 KMD 71.93221162, REVS 1.27173666
# RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 KMD 71.93221162
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5\",\"symbol\":\"KMD\"}" # 71.93221162
sleep 3
echo "71.93221162 <- expected amount RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5"
# RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc KMD 929.58263940
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc\",\"symbol\":\"KMD\"}" # 929.58263940
sleep 3
echo "929.58263940 <- expected amount RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc"
# RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb KMD 38642.70360624
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb\",\"symbol\":\"KMD\"}" # 38642.70360624
sleep 3
echo "38642.70360624 <- expected amount RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb"
# RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF KMD 338.77820389
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF\",\"symbol\":\"KMD\"}" # 338.77820389
sleep 3
echo "338.77820389 <- expected amount RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF"
# RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC KMD 3010.53084291
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC\",\"symbol\":\"KMD\"}" # 3010.53084291
sleep 3
echo "3010.53084291 <- expected amount RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC"
# RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy KMD 9683.15249375
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy\",\"symbol\":\"KMD\"}" # 9683.15249375
sleep 3
echo "9683.15249375 <- expected amount RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy"
# RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1 KMD 1318.49290289
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1\",\"symbol\":\"KMD\"}" # 1318.49290289
sleep 3
echo "1318.49290289 <- expected amount RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1"
# RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC KMD 1696.59450723
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC\",\"symbol\":\"KMD\"}" # 1696.59450723
sleep 3
echo "1696.59450723 <- expected amount RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC"
# RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4 KMD 9294.89681136
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4\",\"symbol\":\"KMD\"}" # 9294.89681136
sleep 3
echo "9294.89681136 <- expected amount RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4"
# RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN KMD 3873.26099750
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN\",\"symbol\":\"KMD\"}" # 3873.26099750
sleep 3
echo "3873.26099750 <- expected amount RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN"
# RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX KMD 48410.92089250
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX\",\"symbol\":\"KMD\"}" # 48410.92089250
sleep 3
echo "48410.92089250 <- expected amount RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX"
# REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg KMD 24342.54200516
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg\",\"symbol\":\"KMD\"}" # 24342.54200516
sleep 3
echo "24342.54200516 <- expected amount REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg"
# RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy KMD 224445.72348323
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy\",\"symbol\":\"KMD\"}" # 224445.72348323
sleep 3
echo "224445.72348323 <- expected amount RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy"
# RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u KMD 4163.75557231
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u\",\"symbol\":\"KMD\"}" # 4163.75557231
sleep 3
echo "4163.75557231 <- expected amount RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u"
# RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW KMD 1060.11153500
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW\",\"symbol\":\"KMD\"}" # 1060.11153500
sleep 3
echo "1060.11153500 <- expected amount RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW"
# RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM KMD 5526.71509918
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM\",\"symbol\":\"KMD\"}" # 5526.71509918
sleep 3
echo "5526.71509918 <- expected amount RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM"
# RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb KMD 163809.81597006, REVS 3251.55110000
# RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb KMD 163809.81597006
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb\",\"symbol\":\"KMD\"}" # 163809.81597006
sleep 3
echo "163809.81597006 <- expected amount RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb"
# RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN KMD 968.31524937
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN\",\"symbol\":\"KMD\"}" # 968.31524937
sleep 3
echo "968.31524937 <- expected amount RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN"
# RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq KMD 4785.58282591, REVS 2.73080820
# RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq KMD 4785.58282591
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq\",\"symbol\":\"KMD\"}" # 4785.58282591
sleep 3
echo "4785.58282591 <- expected amount RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq"
# REALH3GPjNeVt3q9URisFKKCvjZd6NQcid KMD 631.99999696
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"REALH3GPjNeVt3q9URisFKKCvjZd6NQcid\",\"symbol\":\"KMD\"}" # 631.99999696
sleep 3
echo "631.99999696 <- expected amount REALH3GPjNeVt3q9URisFKKCvjZd6NQcid"
# RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo KMD 2826.51221292
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo\",\"symbol\":\"KMD\"}" # 2826.51221292
sleep 3
echo "2826.51221292 <- expected amount RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo"
# RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q KMD 14524.72874062
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q\",\"symbol\":\"KMD\"}" # 14524.72874062
sleep 3
echo "14524.72874062 <- expected amount RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q"
# RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj KMD 112939.81142424, REVS 2241.80390030
# RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj KMD 112939.81142424
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj\",\"symbol\":\"KMD\"}" # 112939.81142424
sleep 3
echo "112939.81142424 <- expected amount RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj"
# RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v KMD 813.38480947
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v\",\"symbol\":\"KMD\"}" # 813.38480947
sleep 3
echo "813.38480947 <- expected amount RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v"
# RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM KMD 6777.23843037
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM\",\"symbol\":\"KMD\"}" # 6777.23843037
sleep 3
echo "6777.23843037 <- expected amount RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM"
# RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u KMD 253.57894226
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u\",\"symbol\":\"KMD\"}" # 253.57894226
sleep 3
echo "253.57894226 <- expected amount RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u"
# RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7 KMD 4841.57624687
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7\",\"symbol\":\"KMD\"}" # 4841.57624687
sleep 3
echo "4841.57624687 <- expected amount RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7"
# RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU KMD 1788.59446342
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU\",\"symbol\":\"KMD\"}" # 1788.59446342
sleep 3
echo "1788.59446342 <- expected amount RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU"
# RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u KMD 4840.60793162
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u\",\"symbol\":\"KMD\"}" # 4840.60793162
sleep 3
echo "4840.60793162 <- expected amount RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u"
# RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj KMD 21334.16787115
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj\",\"symbol\":\"KMD\"}" # 21334.16787115
sleep 3
echo "21334.16787115 <- expected amount RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj"
# REBRXGotFX5fojy22CFEzq88EbbZux9CjM KMD 2075.39004188
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"REBRXGotFX5fojy22CFEzq88EbbZux9CjM\",\"symbol\":\"KMD\"}" # 2075.39004188
sleep 3
echo "2075.39004188 <- expected amount REBRXGotFX5fojy22CFEzq88EbbZux9CjM"
# RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD KMD 7111.30719141
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD\",\"symbol\":\"KMD\"}" # 7111.30719141
sleep 3
echo "7111.30719141 <- expected amount RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD"
# REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m KMD 142057.63342296
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m\",\"symbol\":\"KMD\"}" # 142057.63342296
sleep 3
echo "142057.63342296 <- expected amount REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m"
# RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK KMD 27999.94713904
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK\",\"symbol\":\"KMD\"}" # 27999.94713904
sleep 3
echo "27999.94713904 <- expected amount RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK"
# RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb KMD 2026.68381694
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb\",\"symbol\":\"KMD\"}" # 2026.68381694
sleep 3
echo "2026.68381694 <- expected amount RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb"
# RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz KMD 264.96107994
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz\",\"symbol\":\"KMD\"}" # 264.96107994
sleep 3
echo "264.96107994 <- expected amount RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz"
# RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY KMD 6951.11546870
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY\",\"symbol\":\"KMD\"}" # 6951.11546870
sleep 3
echo "6951.11546870 <- expected amount RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY"
# RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq KMD 3325.70020871, REVS 65.95939412
# RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq KMD 3325.70020871
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq\",\"symbol\":\"KMD\"}" # 3325.70020871
sleep 3
echo "3325.70020871 <- expected amount RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq"
# RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP KMD 773.87754730
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP\",\"symbol\":\"KMD\"}" # 773.87754730
sleep 3
echo "773.87754730 <- expected amount RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP"
# RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M KMD 8908.50029425
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M\",\"symbol\":\"KMD\"}" # 8908.50029425
sleep 3
echo "8908.50029425 <- expected amount RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M"
# RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD KMD 2802.45988185
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD\",\"symbol\":\"KMD\"}" # 2802.45988185
sleep 3
echo "2802.45988185 <- expected amount RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD"
# R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz KMD 27199.08040085
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz\",\"symbol\":\"KMD\"}" # 27199.08040085
sleep 3
echo "27199.08040085 <- expected amount R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz"
# RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz KMD 818.43860613
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz\",\"symbol\":\"KMD\"}" # 818.43860613
sleep 3
echo "818.43860613 <- expected amount RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz"
# RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN KMD 1544.33012483
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN\",\"symbol\":\"KMD\"}" # 1544.33012483
sleep 3
echo "1544.33012483 <- expected amount RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN"
# R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg KMD 30016.80441537
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg\",\"symbol\":\"KMD\"}" # 30016.80441537
sleep 3
echo "30016.80441537 <- expected amount R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg"
# RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN KMD 4146.19464926
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN\",\"symbol\":\"KMD\"}" # 4146.19464926
sleep 3
echo "4146.19464926 <- expected amount RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN"
# RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut KMD 24089.07982436
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut\",\"symbol\":\"KMD\"}" # 24089.07982436
sleep 3
echo "24089.07982436 <- expected amount RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut"
# RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv KMD 693.08132289
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv\",\"symbol\":\"KMD\"}" # 693.08132289
sleep 3
echo "693.08132289 <- expected amount RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv"

200
iguana/tests/KMD.batch9.listunspent

@ -0,0 +1,200 @@
# RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL KMD 2225.74637484
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL\",\"symbol\":\"KMD\"}"
echo "2225.74637484 <- expected amount RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL"
# RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 KMD 71.93221162, REVS 1.27173666
# RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 KMD 71.93221162
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5\",\"symbol\":\"KMD\"}"
echo "71.93221162 <- expected amount RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5"
# RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc KMD 929.58263940
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc\",\"symbol\":\"KMD\"}"
echo "929.58263940 <- expected amount RJ8xVxojynDtLj4MVY1Tsxvkv4Sbwajutc"
# RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb KMD 38642.70360624
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb\",\"symbol\":\"KMD\"}"
echo "38642.70360624 <- expected amount RSEGac8BnijkbygChtYXnMnLUpAvWvhHWb"
# RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF KMD 338.77820389
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF\",\"symbol\":\"KMD\"}"
echo "338.77820389 <- expected amount RKQPNcePppEkV4CMXZrwqEMAvRHbruKVdF"
# RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC KMD 3010.53084291
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC\",\"symbol\":\"KMD\"}"
echo "3010.53084291 <- expected amount RNHXPTTCq6tMb7xV52ermT9s6k29HN2TJC"
# RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy KMD 9683.15249375
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy\",\"symbol\":\"KMD\"}"
echo "9683.15249375 <- expected amount RHptgvQVXDWFckRfgocRbEWxbQoPBKsWcy"
# RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1 KMD 1318.49290289
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1\",\"symbol\":\"KMD\"}"
echo "1318.49290289 <- expected amount RFutyg6w7miN1FPvJiNwTzV1NfJ4Y4HGt1"
# RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC KMD 1696.59450723
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC\",\"symbol\":\"KMD\"}"
echo "1696.59450723 <- expected amount RGMX8qe4DgbPTXTYZXmLowXf6hriQuzhyC"
# RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4 KMD 9294.89681136
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4\",\"symbol\":\"KMD\"}"
echo "9294.89681136 <- expected amount RVN1oyNtmgWGteHfdiQcnzUUHz48STqxg4"
# RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN KMD 3873.26099750
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN\",\"symbol\":\"KMD\"}"
echo "3873.26099750 <- expected amount RQQgVtao1Li8RmvhUaZR3DYLMEv1boWiSN"
# RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX KMD 48410.92089250
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX\",\"symbol\":\"KMD\"}"
echo "48410.92089250 <- expected amount RJNbZ57kzkNkA4fBmKynhXFddH4njTbUcX"
# REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg KMD 24342.54200516
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg\",\"symbol\":\"KMD\"}"
echo "24342.54200516 <- expected amount REM9dVPx7ZkMKEVyFnNJ9CDJGCmE8UL1vg"
# RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy KMD 224445.72348323
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy\",\"symbol\":\"KMD\"}"
echo "224445.72348323 <- expected amount RKdNj83UsxCDPHKh6AyN28nGtUVxJZywuy"
# RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u KMD 4163.75557231
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u\",\"symbol\":\"KMD\"}"
echo "4163.75557231 <- expected amount RKBoXULPPTR2QyAH6axGTsXncbT8mfGS2u"
# RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW KMD 1060.11153500
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW\",\"symbol\":\"KMD\"}"
echo "1060.11153500 <- expected amount RLu1gA75ySXwnYsimbUdtJr6xFJTqXrKJW"
# RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM KMD 5526.71509918
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM\",\"symbol\":\"KMD\"}"
echo "5526.71509918 <- expected amount RMJXpqJjgPrbNCpLnug3LKzqjYCJ2AmDVM"
# RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb KMD 163809.81597006, REVS 3251.55110000
# RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb KMD 163809.81597006
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb\",\"symbol\":\"KMD\"}"
echo "163809.81597006 <- expected amount RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb"
# RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN KMD 968.31524937
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN\",\"symbol\":\"KMD\"}"
echo "968.31524937 <- expected amount RDSVuxLxeFYLqisj9Tdk5ThB5PzY7HBptN"
# RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq KMD 4785.58282591, REVS 2.73080820
# RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq KMD 4785.58282591
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq\",\"symbol\":\"KMD\"}"
echo "4785.58282591 <- expected amount RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq"
# REALH3GPjNeVt3q9URisFKKCvjZd6NQcid KMD 631.99999696
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"REALH3GPjNeVt3q9URisFKKCvjZd6NQcid\",\"symbol\":\"KMD\"}"
echo "631.99999696 <- expected amount REALH3GPjNeVt3q9URisFKKCvjZd6NQcid"
# RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo KMD 2826.51221292
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo\",\"symbol\":\"KMD\"}"
echo "2826.51221292 <- expected amount RTKmpREsZKc28s3oQAuWqGYh1xVtwJjHBo"
# RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q KMD 14524.72874062
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q\",\"symbol\":\"KMD\"}"
echo "14524.72874062 <- expected amount RA27UHcoKZuDU5dE8eBjcFNdGHgaw2ux6q"
# RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj KMD 112939.81142424, REVS 2241.80390030
# RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj KMD 112939.81142424
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj\",\"symbol\":\"KMD\"}"
echo "112939.81142424 <- expected amount RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj"
# RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v KMD 813.38480947
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v\",\"symbol\":\"KMD\"}"
echo "813.38480947 <- expected amount RPJ9T5XcXJgqf1PstxE5xzFFWq7vonAr5v"
# RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM KMD 6777.23843037
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM\",\"symbol\":\"KMD\"}"
echo "6777.23843037 <- expected amount RHzaoiAXNB6AkUXbpwVBapd2dpsDBxWtLM"
# RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u KMD 253.57894226
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u\",\"symbol\":\"KMD\"}"
echo "253.57894226 <- expected amount RER2vwRLHFT4HNQLzyqT1PhbeMCitDaY1u"
# RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7 KMD 4841.57624687
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7\",\"symbol\":\"KMD\"}"
echo "4841.57624687 <- expected amount RYZ62rj6VEgojsWhkxT5ucV6kZnwMGBKr7"
# RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU KMD 1788.59446342
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU\",\"symbol\":\"KMD\"}"
echo "1788.59446342 <- expected amount RU21Y5CyH5xgGC5aHdqXoss8z7wkNQoacU"
# RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u KMD 4840.60793162
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u\",\"symbol\":\"KMD\"}"
echo "4840.60793162 <- expected amount RJ8tyXNVoi4iLLMJxirCYzRj1tXpUFmN2u"
# RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj KMD 21334.16787115
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj\",\"symbol\":\"KMD\"}"
echo "21334.16787115 <- expected amount RFkZfkHiRrtAmSMsfj7CVS6hkvLagEqYKj"
# REBRXGotFX5fojy22CFEzq88EbbZux9CjM KMD 2075.39004188
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"REBRXGotFX5fojy22CFEzq88EbbZux9CjM\",\"symbol\":\"KMD\"}"
echo "2075.39004188 <- expected amount REBRXGotFX5fojy22CFEzq88EbbZux9CjM"
# RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD KMD 7111.30719141
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD\",\"symbol\":\"KMD\"}"
echo "7111.30719141 <- expected amount RFZyBhemdJqpRSppnVYPJZ5wUW6JtbnsHD"
# REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m KMD 142057.63342296
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m\",\"symbol\":\"KMD\"}"
echo "142057.63342296 <- expected amount REbV2nRwPWFAdrW2BzmjpDpxTNErm2468m"
# RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK KMD 27999.94713904
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK\",\"symbol\":\"KMD\"}"
echo "27999.94713904 <- expected amount RYRiQU4nVLcjaEtqtrNpDQBRS3ovbjDFaK"
# RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb KMD 2026.68381694
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb\",\"symbol\":\"KMD\"}"
echo "2026.68381694 <- expected amount RU292SeuDimqFSdZXmdmjd1BZcxLWzqqfb"
# RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz KMD 264.96107994
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz\",\"symbol\":\"KMD\"}"
echo "264.96107994 <- expected amount RXTemgKRoF4d28V5fLJxAWWcJyaoTRmZyz"
# RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY KMD 6951.11546870
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY\",\"symbol\":\"KMD\"}"
echo "6951.11546870 <- expected amount RPx4vRAMxvAjH33g6q4a27UL3CHcJtJ8VY"
# RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq KMD 3325.70020871, REVS 65.95939412
# RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq KMD 3325.70020871
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq\",\"symbol\":\"KMD\"}"
echo "3325.70020871 <- expected amount RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq"
# RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP KMD 773.87754730
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP\",\"symbol\":\"KMD\"}"
echo "773.87754730 <- expected amount RFPHfk7EtgVSoiFJLXgu8tbfXFJSbsN4cP"
# RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M KMD 8908.50029425
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M\",\"symbol\":\"KMD\"}"
echo "8908.50029425 <- expected amount RPHUJ7RmVAPCFqPhxpxo6E4kc54w7t5A8M"
# RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD KMD 2802.45988185
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD\",\"symbol\":\"KMD\"}"
echo "2802.45988185 <- expected amount RCkPBpsQtbB2JDbHLU4RpC2DecxRvpZ9BD"
# R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz KMD 27199.08040085
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz\",\"symbol\":\"KMD\"}"
echo "27199.08040085 <- expected amount R9kB2xFTKB5wMXTW6i7bNiEWx4hsJKCzbz"
# RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz KMD 818.43860613
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz\",\"symbol\":\"KMD\"}"
echo "818.43860613 <- expected amount RWwjkQec3yhivp7UuWRqYWvKJDA3EAADZz"
# RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN KMD 1544.33012483
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN\",\"symbol\":\"KMD\"}"
echo "1544.33012483 <- expected amount RBBwTTeLq3tkeBg5GxKX6JugEv5pTijiyN"
# R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg KMD 30016.80441537
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg\",\"symbol\":\"KMD\"}"
echo "30016.80441537 <- expected amount R9Jz7RWJ6LVBhrt2RgY6SSMWEkmKHqz5qg"
# RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN KMD 4146.19464926
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN\",\"symbol\":\"KMD\"}"
echo "4146.19464926 <- expected amount RXBFW2KavmhfhbkEbofYueD66Laq4kYZQN"
# RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut KMD 24089.07982436
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut\",\"symbol\":\"KMD\"}"
echo "24089.07982436 <- expected amount RXdBJ5cWDcS38ykuggEQZh3vSztxwmG3ut"
# RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv KMD 693.08132289
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv\",\"symbol\":\"KMD\"}"
echo "693.08132289 <- expected amount RHJ55iWUQNbKcSn8shbv1RbGuip3RSRHFv"

27
iguana/tests/REVS.batch9

@ -0,0 +1,27 @@
# RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL KMD 2225.74637484, REVS 44.17250867
sleep 1
fiat/revs sendtoaddress RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL 44.17250867
# RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 KMD 71.93221162, REVS 1.27173666
sleep 1
fiat/revs sendtoaddress RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 1.27173666
# RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb KMD 163809.81597006, REVS 3251.55110000
sleep 1
fiat/revs sendtoaddress RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb 3251.55110000
# RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq KMD 4785.58282591, REVS 2.73080820
sleep 1
fiat/revs sendtoaddress RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq 2.73080820
# RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj KMD 112939.81142424, REVS 2241.80390030
sleep 1
fiat/revs sendtoaddress RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj 2241.80390030
# RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq KMD 3325.70020871, REVS 65.95939412
sleep 1
fiat/revs sendtoaddress RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq 65.95939412
# total KMD 0.00000000 REVS 5607.48944795
d5d9950efea532582846b744eaf4e922556fa1446a2364fd55aaa90f4510106b
48acaf51ecc7aba3209bb2532c777ee9594c66d46056cb8003a11cc16c6bbb27
5c06f259610af698bed238b1a849201c5ef1bd05619773f4df5e930d1a926b40
f871cf48871b1bf6ccd9a388876ab911666b045da981ccd49f3d54315fdeac11
e0db5b8c49fe3d7f0a51df0844bb7b04838661a436575f5b8c8c895ed8c33349
ab617a095862b0db6d3aeec36e628b2d67aa7130548fac7d9be950b7687fec8b

18
iguana/tests/REVS.batch9.importaddress

@ -0,0 +1,18 @@
# RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL KMD 2225.74637484, REVS 44.17250867
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RPFYcaJ1hLGSNeMAyPyNmFeJaXPKMSPtbL\",\"symbol\":\"REVS\"}" # 44.17250867
sleep 3
# RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5 KMD 71.93221162, REVS 1.27173666
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RQMnsa46FhvHnwg7M1DsUKnh8GPTbUqCJ5\",\"symbol\":\"REVS\"}" # 1.27173666
sleep 3
# RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb KMD 163809.81597006, REVS 3251.55110000
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RW8FwjCAcV8SWJaT1r8aKiFHXit5pfPkVb\",\"symbol\":\"REVS\"}" # 3251.55110000
sleep 3
# RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq KMD 4785.58282591, REVS 2.73080820
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RSXBDSmt7rsPJNg4Cy6tVZCQRyWv2oRmdq\",\"symbol\":\"REVS\"}" # 2.73080820
sleep 3
# RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj KMD 112939.81142424, REVS 2241.80390030
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RVVsTRZDt1ywJ115KB22kpwUGEba21aJfj\",\"symbol\":\"REVS\"}" # 2241.80390030
sleep 3
# RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq KMD 3325.70020871, REVS 65.95939412
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RH8q81jTRuH35g2g59iT3kxJWoF9Unzgqq\",\"symbol\":\"REVS\"}" # 65.95939412
sleep 3

2
iguana/tests/dexgetO

@ -1,2 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"gettxout\",\"vout\":0,\"txid\":\"cad09f4c3e23ef4cde4980cc0e2b296943f22cbaac183a30f86f49f7eccfedfd\",\"symbol\":\"BTC\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"gettxout\",\"vout\":1,\"txid\":\"fa3321ed55e8e96ba7221e9cc4bc54b735616649abcc9734bb73f505ee712884\",\"symbol\":\"KMD\"}"

2
iguana/tests/refresh

@ -0,0 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"refresh\",\"symbol\":\"KMD\",\"address\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"timeout\":600000}"

2
iguana/tests/utxorawtx

@ -0,0 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"symbol\":\"KMD\",\"agent\":\"basilisk\",\"method\":\"utxorawtx\",\"vals\":{\"timelock\":0,\"changeaddr\":\"RNmvQtThVZAbc1tFEFmKAnJZrc9XqciNog\",\"destaddr\":\"RHfraY22xd9aAuuUJ6Yjb6HFUXh535z6Lg\",\"txfee\":0.00011,\"amount\":0.01,\"sendflag\":0},\"utxos\":[{\"bestblock\":\"000000a7d7b317af7169a156f6b4b9538293da2a3707a69aa3048998a87fbf2c\",\"confirmations\":0,\"value\":0.02,\"scriptPubKey\":{\"asm\":\"OP_DUP OP_HASH160 b7128d2ee837cf03e30a2c0e3e0181f7b9669bb6 OP_EQUALVERIFY OP_CHECKSIG\",\"hex\":\"76a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac\",\"reqSigs\":1,\"type\":\"pubkeyhash\",\"addresses\":[\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\"]},\"version\":1,\"coinbase\":false,\"randipbits\":3350674129,\"coin\":\"KMD\",\"txid\":\"9329814cc4c7a8cabf83627d4228c1a2090e776d669c585d824d912ce2e13b13\",\"vout\":1,\"amount\":0.02}]}"

2
includes/iguana_apideclares.h

@ -76,6 +76,8 @@ INT_ARG(basilisk,paxfiats,mask);
HASH_ARRAY_STRING(basilisk,balances,hash,vals,hexstr);
HASH_ARRAY_STRING(basilisk,value,hash,vals,hexstr);
HASH_ARRAY_STRING(basilisk,rawtx,hash,vals,hexstr);
TWO_STRINGS(basilisk,refresh,symbol,address);
STRING_ARRAY_OBJ_STRING(basilisk,utxorawtx,symbol,utxos,vals,ignore);
HASH_ARRAY_STRING(basilisk,getmessage,hash,vals,hexstr);
HASH_ARRAY_STRING(basilisk,sendmessage,hash,vals,hexstr);

2
includes/iguana_funcs.h

@ -638,7 +638,9 @@ void libgfshare_init(struct supernet_info *myinfo,uint8_t _logs[256],uint8_t _ex
int32_t init_sharenrs(uint8_t sharenrs[255],uint8_t *orig,int32_t m,int32_t n);
void iguana_schnorr(struct supernet_info *myinfo);
void iguana_fixsecp(struct supernet_info *myinfo);
int32_t bitcoin_timelockspend(uint8_t *script,int32_t n,uint8_t rmd160[20],uint32_t timestamp);
char *iguana_calcutxorawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJSON **vinsp,cJSON *txobj,int64_t satoshis,char *changeaddr,int64_t txfee,cJSON *utxos,char *remoteaddr,struct vin_info *V,int32_t maxmode);
#include "../includes/iguana_api.h"

10
includes/iguana_structs.h

@ -185,7 +185,7 @@ struct msgcounts { uint32_t version,verack,getaddr,addr,inv,getdata,notfound,get
//struct iguana_fileitem { bits256 hash2; struct iguana_txdatabits txdatabits; };
struct iguana_kvitem { UT_hash_handle hh; uint8_t keyvalue[]; }PACKEDSTRUCT;
struct iguana_kvitem { UT_hash_handle hh; uint8_t keyvalue[]; };
struct iguana_iAddr
{
@ -223,13 +223,13 @@ struct iguana_block
{
iguana_blockfields;
struct iguana_zcashRO zRO[];
} PACKEDSTRUCT;
} ;
struct iguana_zblock // mu
{
iguana_blockfields; // this is to minimize code needed to support both types
struct iguana_zcashRO zRO; // if zRO is changed, the RO part must also be updated
} PACKEDSTRUCT;
} ;
#define IGUANA_LHASH_BLOCKS 0
#define IGUANA_LHASH_TXIDS 1 //
@ -285,8 +285,8 @@ struct iguana_utxo { uint32_t fromheight:31,lockedflag:1,prevunspentind:31,spent
#ifdef DEPRECATED_HHUTXO
struct iguana_hhaccount { UT_hash_handle hh; uint64_t pval; struct iguana_account a; }PACKEDSTRUCT;
#endif
struct iguana_hhutxo { UT_hash_handle hh; uint64_t uval; struct iguana_utxo u; }PACKEDSTRUCT;
struct iguana_utxoaddr { UT_hash_handle hh; uint64_t histbalance; uint32_t pkind:30,p2sh:1,searchedhist:1; uint16_t hdrsi; uint8_t rmd160[20]; }PACKEDSTRUCT;
struct iguana_hhutxo { UT_hash_handle hh; uint64_t uval; struct iguana_utxo u; };
struct iguana_utxoaddr { UT_hash_handle hh; uint64_t histbalance; uint32_t pkind:30,p2sh:1,searchedhist:1; uint16_t hdrsi; uint8_t rmd160[20]; };
// GLOBAL one zero to non-zero write (unless reorg)
struct iguana_spendvector { uint64_t value; uint32_t pkind,unspentind; int32_t fromheight; uint16_t hdrsi:15,tmpflag:1; }PACKEDSTRUCT; // unspentind

Loading…
Cancel
Save