From c7218cc76b72e28dc19aa2526deab67f36092c9b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 18:07:14 +0300 Subject: [PATCH 01/98] Txblast code --- iguana/exchanges/LP_transaction.c | 198 ++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 79606f249..98c24e33d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1518,6 +1518,204 @@ char *LP_opreturndecrypt(void *ctx,char *symbol,bits256 utxotxid,char *passphras return(jprint(retjson,1)); } +char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **txobjp,cJSON **vinsp,struct vin_info *V,struct iguana_info *coin,bits256 utxotxid,int32_t utxovout,uint64_t utxovalue,bits256 privkey,cJSON *outputs,int64_t txfee) +{ + static void *ctx; + cJSON *txobj,*item; uint8_t addrtype,rmd160[20],data[8192+64],script[8192],spendscript[256]; char *coinaddr,*rawtxbytes,*scriptstr,spendscriptstr[128],wifstr[64]; bits256 txid; uint32_t crc32,timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,offset,len,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + *txobjp = *vinsp = 0; + *changep = 0; + *changeoutp = -1; + if ( coin == 0 || outputs == 0 || (numvouts= cJSON_GetArraySize(outputs)) <= 0 ) + { + printf("LP_createrawtransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); + return(0); + } + amount = txfee; + for (i=0; isymbol,coinaddr) <= 0 ) + { + printf("%s LP_createrawtransaction %s i.%d of %d is invalid\n",coin->symbol,coinaddr,i,numvouts); + return(0); + } + if ( (value= SATOSHIDEN * jdouble(item,coinaddr)) <= 0 ) + { + printf("cant get value %s i.%d of %d %s\n",coinaddr,i,numvouts,jprint(outputs,0)); + return(0); + } + amount += value; + //printf("vout.%d %.8f -> total %.8f\n",i,dstr(value),dstr(amount)); + } + else + { + printf("cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + return(0); + } + } + ignore_cltverr = 0; + suppress_pubkeys = 1; + memset(V,0,sizeof(*V)); + V->N = V->M = 1; + V->signers[0].privkey = privkey; + bitcoin_priv2wif(coin->symbol,coin->wiftaddr,wifstr,privkey,coin->wiftype); + V->suppress_pubkeys = suppress_pubkeys; + V->ignore_cltverr = ignore_cltverr; + change = (utxovalue - amount); + timestamp = (uint32_t)time(NULL); + locktime = 0; + txobj = bitcoin_txcreate(coin->symbol,coin->isPoS,locktime,coin->txversion,timestamp); + scriptlen = bitcoin_standardspend(script,0,G.LP_myrmd160); + init_hexbytes_noT(spendscriptstr,script,scriptlen); + vins = cJSON_CreateArray(); + jaddi(vins,LP_inputjson(utxotxid,utxovout,spendscriptstr)); + jdelete(txobj,"vin"); + jadd(txobj,"vin",jduplicate(vins)); + *vinsp = vins; + for (i=0; i> 1; + if ( spendlen < sizeof(script) ) + { + decode_hex(spendscript,spendlen,scriptstr); + //printf("i.%d using external script.(%s) %d\n",i,scriptstr,spendlen); + } + else + { + printf("custom script.%d too long %d\n",i,spendlen); + free_json(txobj); + return(0); + } + } + else + { + bitcoin_addr2rmd160(coin->symbol,coin->taddr,&addrtype,rmd160,coinaddr); + if ( addrtype == coin->pubtype ) + spendlen = bitcoin_standardspend(spendscript,0,rmd160); + else spendlen = bitcoin_p2shspend(spendscript,0,rmd160); + if ( i == numvouts-1 && strcmp(coinaddr,coin->smartaddr) == 0 && change != 0 ) + { + value += change; + change = 0; + } + } + txobj = bitcoin_txoutput(txobj,spendscript,spendlen,value + adjust); + } + else + { + printf("cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + free_json(txobj); + return(0); + } + } + if ( change < 6000 ) + change = 0; + *changep = change; + if ( change != 0 ) + { + txobj = bitcoin_txoutput(txobj,script,scriptlen,change); + *changeoutp = numvouts; + } + if ( (rawtxbytes= bitcoin_json2hex(coin->symbol,coin->isPoS,&txid,txobj,V)) == 0 ) + printf("error making rawtx suppress.%d\n",suppress_pubkeys); + *txobjp = txobj; + return(rawtxbytes); +} + +char *LP_txblast(struct iguana_info *coin,cJSON *argjson) +{ + static void *ctx; + int32_t broadcast,i,num,numblast,utxovout,completed=0,numvouts,changeout; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info V; uint32_t locktime,starttime; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 utxotxid,signedtxid; uint64_t txfee,utxovalue,change; + if ( ctx == 0 ) + ctx = bitcoin_ctx(); + outputs = jarray(&numvouts,argjson,"outputs"); + utxotxid = jbits256(argjson,"utxotxid"); + utxovout = jint(argjson,"utxovout"); + numblast = jint(argjson,"numblast"); + utxovalue = j64bits(argjson,"utxovalue"); + txfee = juint(argjson,"txfee"); + safecopy(vinaddr,coin->smartaddr,sizeof(vinaddr)); + safecopy(changeaddr,coin->smartaddr,sizeof(changeaddr)); + privkey = LP_privkey(coin->symbol,vinaddr,coin->taddr); + bitcoin_priv2wif(coin->symbol,coin->wiftaddr,wifstr,privkey,coin->wiftype); + privkeys = cJSON_CreateArray(); + jaddistr(privkeys,wifstr); + starttime = (uint32_t)time(NULL); + for (i=0; isymbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,&V,1,rawtx,vins,privkeys,coin->zcash)) < 0 ) + printf("couldnt sign withdraw %s\n",bits256_str(str,signedtxid)); + else if ( completed == 0 ) + { + printf("incomplete signing withdraw (%s)\n",jprint(vins,0)); + break; + } + else + { + if ( broadcast != 0 ) + { + if ( (signret= LP_sendrawtransaction(coin->symbol,signedtx)) != 0 ) + { + printf("LP_txblast.%s broadcast (%s)\n",coin->symbol,bits256_str(str,signedtxid),signret); + if ( is_hexstr(signret,0) == 64 ) + { + decode_hex(checktxid.bytes,32,signeret); + if ( bits256_cmp(checktxid,signedtxid) == 0 ) + { + printf("blaster i.%d of %d: %s/v%d %.8f\n",i,numblast,bits256_str(str,signedtxid),changeout,dstr(change)); + } else break; + } else break; + free(signret); + } else break; + } else printf("blaster i.%d of %d: %s/v%d %.8f\n",i,numblast,bits256_str(str,signedtxid),changeout,dstr(change)); + } + } else break; + if ( txobj != 0 ) + free_json(txobj), txobj = 0; + if ( rawtx != 0 ) + free(rawtx), rawtx = 0; + if ( signedtx != 0 ) + free(signedtx), signedtx = 0; + if ( changeout < 0 || change == 0 ) + break; + utxotxid = signedtxid; + utxovout = changeout; + utxovalue = change; + // good place to update outputs[] for a fully programmable blast + } + free_json(privkeys), privkeys = 0; + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddnum(retjson,"numblast",numblast); + jaddnum(retjson,"completed",i); + jaddbits256(retjson,"lastutxo",utxotxid); + jaddint(retjson,"lastutxovout",utxovout); + jaddnum(retjson,"lastutxovalue",dstr(utxovalue)); + jaddnum(retjson,"elapsed",(uint32_t)time(NULL) - starttime); + jaddnum(retjson,"tx/sec",(double)i / ((uint32_t)time(NULL) - starttime + 1)); + return(jprint(retjson,1)); +} + char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) { static void *ctx; From e48c3a9d24203e36c6823696a8d78b926619feb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 18:09:59 +0300 Subject: [PATCH 02/98] Syntax --- iguana/exchanges/LP_transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 98c24e33d..86a8f4645 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1521,7 +1521,7 @@ char *LP_opreturndecrypt(void *ctx,char *symbol,bits256 utxotxid,char *passphras char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **txobjp,cJSON **vinsp,struct vin_info *V,struct iguana_info *coin,bits256 utxotxid,int32_t utxovout,uint64_t utxovalue,bits256 privkey,cJSON *outputs,int64_t txfee) { static void *ctx; - cJSON *txobj,*item; uint8_t addrtype,rmd160[20],data[8192+64],script[8192],spendscript[256]; char *coinaddr,*rawtxbytes,*scriptstr,spendscriptstr[128],wifstr[64]; bits256 txid; uint32_t crc32,timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,offset,len,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0; + cJSON *txobj,*item,*vins; uint8_t addrtype,rmd160[20],data[8192+64],script[8192],spendscript[256]; char *coinaddr,*rawtxbytes,*scriptstr,spendscriptstr[128],wifstr[64]; bits256 txid; uint32_t locktime,crc32,timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,offset,len,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0; if ( ctx == 0 ) ctx = bitcoin_ctx(); *txobjp = *vinsp = 0; @@ -1658,7 +1658,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) starttime = (uint32_t)time(NULL); for (i=0; i Date: Sat, 21 Apr 2018 18:11:18 +0300 Subject: [PATCH 03/98] Fix --- iguana/exchanges/LP_transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 86a8f4645..83b94e220 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1640,7 +1640,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx char *LP_txblast(struct iguana_info *coin,cJSON *argjson) { static void *ctx; - int32_t broadcast,i,num,numblast,utxovout,completed=0,numvouts,changeout; bits256 privkey; char changeaddr[64],vinaddr[64],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info V; uint32_t locktime,starttime; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 utxotxid,signedtxid; uint64_t txfee,utxovalue,change; + int32_t broadcast,i,num,numblast,utxovout,completed=0,numvouts,changeout; bits256 privkey; char changeaddr[64],vinaddr[64],wifstr[65],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info V; uint32_t locktime,starttime; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 checktxid,utxotxid,signedtxid; uint64_t txfee,utxovalue,change; if ( ctx == 0 ) ctx = bitcoin_ctx(); outputs = jarray(&numvouts,argjson,"outputs"); @@ -1679,7 +1679,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) printf("LP_txblast.%s broadcast (%s)\n",coin->symbol,bits256_str(str,signedtxid),signret); if ( is_hexstr(signret,0) == 64 ) { - decode_hex(checktxid.bytes,32,signeret); + decode_hex(checktxid.bytes,32,signret); if ( bits256_cmp(checktxid,signedtxid) == 0 ) { printf("blaster i.%d of %d: %s/v%d %.8f\n",i,numblast,bits256_str(str,signedtxid),changeout,dstr(change)); From 8ead184e334b78a8810d6bdd90ad27acab11040c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 18:11:48 +0300 Subject: [PATCH 04/98] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 83b94e220..6f02382ff 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1709,7 +1709,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) jaddnum(retjson,"numblast",numblast); jaddnum(retjson,"completed",i); jaddbits256(retjson,"lastutxo",utxotxid); - jaddint(retjson,"lastutxovout",utxovout); + jaddnum(retjson,"lastutxovout",utxovout); jaddnum(retjson,"lastutxovalue",dstr(utxovalue)); jaddnum(retjson,"elapsed",(uint32_t)time(NULL) - starttime); jaddnum(retjson,"tx/sec",(double)i / ((uint32_t)time(NULL) - starttime + 1)); From 7bdf1c306da757208b5886772857ff3334314e78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 18:20:50 +0300 Subject: [PATCH 05/98] Make totally independent of wallet --- iguana/exchanges/LP_transaction.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6f02382ff..3ad1796fa 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1640,19 +1640,23 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx char *LP_txblast(struct iguana_info *coin,cJSON *argjson) { static void *ctx; - int32_t broadcast,i,num,numblast,utxovout,completed=0,numvouts,changeout; bits256 privkey; char changeaddr[64],vinaddr[64],wifstr[65],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info V; uint32_t locktime,starttime; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 checktxid,utxotxid,signedtxid; uint64_t txfee,utxovalue,change; + int32_t broadcast,i,num,numblast,utxovout,completed=0,numvouts,changeout; char *passphrase,changeaddr[64],vinaddr[64],wifstr[65],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info V; uint32_t locktime,starttime; uint8_t pubkey33[33]; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 privkey,pubkey,checktxid,utxotxid,signedtxid; uint64_t txfee,utxovalue,change; if ( ctx == 0 ) ctx = bitcoin_ctx(); + if ( (passphrase= jstr(argjson,"passphrase")) == 0 ) + return(clonestr("{\"error\":\"need passphrase\"}")); outputs = jarray(&numvouts,argjson,"outputs"); utxotxid = jbits256(argjson,"utxotxid"); utxovout = jint(argjson,"utxovout"); numblast = jint(argjson,"numblast"); utxovalue = j64bits(argjson,"utxovalue"); txfee = juint(argjson,"txfee"); - safecopy(vinaddr,coin->smartaddr,sizeof(vinaddr)); - safecopy(changeaddr,coin->smartaddr,sizeof(changeaddr)); - privkey = LP_privkey(coin->symbol,vinaddr,coin->taddr); + conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); + privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; bitcoin_priv2wif(coin->symbol,coin->wiftaddr,wifstr,privkey,coin->wiftype); + bitcoin_priv2pub(ctx,coin->symbol,pubkey33,blastaddr,privkey,coin->taddr,coin->pubtype); + safecopy(vinaddr,blastaddr,sizeof(vinaddr)); + safecopy(changeaddr,blastaddr,sizeof(changeaddr)); privkeys = cJSON_CreateArray(); jaddistr(privkeys,wifstr); starttime = (uint32_t)time(NULL); @@ -1676,7 +1680,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) { if ( (signret= LP_sendrawtransaction(coin->symbol,signedtx)) != 0 ) { - printf("LP_txblast.%s broadcast (%s)\n",coin->symbol,bits256_str(str,signedtxid),signret); + printf("LP_txblast.%s broadcast (%s) vs %s\n",coin->symbol,bits256_str(str,signedtxid),signret); if ( is_hexstr(signret,0) == 64 ) { decode_hex(checktxid.bytes,32,signret); @@ -1687,7 +1691,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) } else break; free(signret); } else break; - } else printf("blaster i.%d of %d: %s/v%d %.8f\n",i,numblast,bits256_str(str,signedtxid),changeout,dstr(change)); + } else printf("blaster i.%d of %d: %s/v%d %.8f %s\n",i,numblast,bits256_str(str,signedtxid),changeout,dstr(change),signedtx); } } else break; if ( txobj != 0 ) From 4e5bd03c8f5a7e67340383dd21de8c36d81f7d34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 18:26:14 +0300 Subject: [PATCH 06/98] Add txblast to commands --- iguana/exchanges/LP_commands.c | 7 +++++++ iguana/exchanges/LP_transaction.c | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 8263111c6..3278e03f2 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -120,6 +120,7 @@ cancel(uuid)\n\ buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\ sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\ withdraw(coin, outputs[], broadcast=0)\n\ +txblast(coin, utxotxid, utxovout, utxovalue, txfee, passphrase, outputs[], broadcast=0)\n\ sendrawtransaction(coin, signedtx)\n\ swapstatus(pending=0, fast=0)\n\ swapstatus(coin, limit=10)\n\ @@ -649,6 +650,12 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ { return(jprint(LP_gettx("stats_JSON",coin,jbits256(argjson,"txid"),0),1)); } + else if ( strcmp(method,"txblast") == 0 ) + { + if ( (ptr= LP_coinsearch(coin)) != 0 ) + return(LP_txblast(ptr,argjson)); + else return(clonestr("{\"error\":\"cant find coind\"}")); + } else if ( strcmp(method,"withdraw") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3ad1796fa..990c374bc 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1640,7 +1640,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx char *LP_txblast(struct iguana_info *coin,cJSON *argjson) { static void *ctx; - int32_t broadcast,i,num,numblast,utxovout,completed=0,numvouts,changeout; char *passphrase,changeaddr[64],vinaddr[64],wifstr[65],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info V; uint32_t locktime,starttime; uint8_t pubkey33[33]; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 privkey,pubkey,checktxid,utxotxid,signedtxid; uint64_t txfee,utxovalue,change; + int32_t broadcast,i,num,numblast,utxovout,completed=0,numvouts,changeout; char *passphrase,changeaddr[64],vinaddr[64],wifstr[65],blastaddr[65],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info V; uint32_t locktime,starttime; uint8_t pubkey33[33]; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 privkey,pubkey,checktxid,utxotxid,signedtxid; uint64_t txfee,utxovalue,change; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( (passphrase= jstr(argjson,"passphrase")) == 0 ) @@ -1651,7 +1651,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) numblast = jint(argjson,"numblast"); utxovalue = j64bits(argjson,"utxovalue"); txfee = juint(argjson,"txfee"); - conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); + conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; bitcoin_priv2wif(coin->symbol,coin->wiftaddr,wifstr,privkey,coin->wiftype); bitcoin_priv2pub(ctx,coin->symbol,pubkey33,blastaddr,privkey,coin->taddr,coin->pubtype); @@ -1710,6 +1710,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) free_json(privkeys), privkeys = 0; retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); + jaddstr(retjson,"blastaddr",blastaddr); jaddnum(retjson,"numblast",numblast); jaddnum(retjson,"completed",i); jaddbits256(retjson,"lastutxo",utxotxid); From 6b648e27b515e07b39579cceb7bee2b09bde90ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 18:34:27 +0300 Subject: [PATCH 07/98] Txblast test script --- iguana/exchanges/LP_transaction.c | 4 ++-- iguana/exchanges/txblast | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100755 iguana/exchanges/txblast diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 990c374bc..78a72867a 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1643,8 +1643,8 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) int32_t broadcast,i,num,numblast,utxovout,completed=0,numvouts,changeout; char *passphrase,changeaddr[64],vinaddr[64],wifstr[65],blastaddr[65],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info V; uint32_t locktime,starttime; uint8_t pubkey33[33]; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 privkey,pubkey,checktxid,utxotxid,signedtxid; uint64_t txfee,utxovalue,change; if ( ctx == 0 ) ctx = bitcoin_ctx(); - if ( (passphrase= jstr(argjson,"passphrase")) == 0 ) - return(clonestr("{\"error\":\"need passphrase\"}")); + if ( (passphrase= jstr(argjson,"password")) == 0 ) + return(clonestr("{\"error\":\"need password\"}")); outputs = jarray(&numvouts,argjson,"outputs"); utxotxid = jbits256(argjson,"utxotxid"); utxovout = jint(argjson,"utxovout"); diff --git a/iguana/exchanges/txblast b/iguana/exchanges/txblast new file mode 100755 index 000000000..cc0d5465b --- /dev/null +++ b/iguana/exchanges/txblast @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"password\":\"default\",\"utxotxid\":\"44ea381e265a29ead0a23d93245be26f828c6e0098e7732fb4101d46c50b8687\",\"utxovout\":1,\"utxovalue\":100000000,\"txfee\":20000,\"method\":\"txblast\",\"coin\":\"PIZZA\",\"outputs\":[{\"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.0001}, {\"RLMHGUQginEGrnRtHoFBPZhLC9jeVdt1th\":0.0001}]}" From d7408812e049cebe6896b7ddd2e82bec33fc0ea2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 18:36:02 +0300 Subject: [PATCH 08/98] Test --- iguana/exchanges/LP_transaction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 78a72867a..6d51e4259 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1648,7 +1648,8 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) outputs = jarray(&numvouts,argjson,"outputs"); utxotxid = jbits256(argjson,"utxotxid"); utxovout = jint(argjson,"utxovout"); - numblast = jint(argjson,"numblast"); + if ( (numblast= jint(argjson,"numblast")) == 0 ) + numblast = 1000000; utxovalue = j64bits(argjson,"utxovalue"); txfee = juint(argjson,"txfee"); conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); From a5d3b80eb58f0d70c387c3f214c6e1c5ccdd2e3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 18:52:27 +0300 Subject: [PATCH 09/98] Test --- iguana/exchanges/LP_transaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6d51e4259..059463cee 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1652,6 +1652,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) numblast = 1000000; utxovalue = j64bits(argjson,"utxovalue"); txfee = juint(argjson,"txfee"); + broadcast = juint(argjson,"broadcast"); conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; bitcoin_priv2wif(coin->symbol,coin->wiftaddr,wifstr,privkey,coin->wiftype); @@ -1712,6 +1713,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) retjson = cJSON_CreateObject(); jaddstr(retjson,"result","success"); jaddstr(retjson,"blastaddr",blastaddr); + jaddnum(retjson,"broadcast",broadcast); jaddnum(retjson,"numblast",numblast); jaddnum(retjson,"completed",i); jaddbits256(retjson,"lastutxo",utxotxid); From c9552b82e97bdd501d3b723821e3cb06acd95fb6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 19:01:40 +0300 Subject: [PATCH 10/98] Updated txblast script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You need to specify: passphrase: for an address NOT in your wallet! utxotxid, utxovout and utxovalue (in satoshi) txfee must be enough for the transaction numblast if left off will consume the entire utxotxid at about 100 tx/sec Broadcast:0 for test run, 1 to actually broadcast The rest of the parameters are just like “withdraw” it will just blast away and use only one utxo --- iguana/exchanges/txblast | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/txblast b/iguana/exchanges/txblast index cc0d5465b..4ed3fc9e3 100755 --- a/iguana/exchanges/txblast +++ b/iguana/exchanges/txblast @@ -1,3 +1,4 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"password\":\"default\",\"utxotxid\":\"44ea381e265a29ead0a23d93245be26f828c6e0098e7732fb4101d46c50b8687\",\"utxovout\":1,\"utxovalue\":100000000,\"txfee\":20000,\"method\":\"txblast\",\"coin\":\"PIZZA\",\"outputs\":[{\"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.0001}, {\"RLMHGUQginEGrnRtHoFBPZhLC9jeVdt1th\":0.0001}]}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"broadcast\":1,\"numblast\":1000,\"password\":\"default\",\"utxotxid\":\"bf8b73b2f72fbff1546811749eba3a028bce6320e5cdf2ae1ae414277661fb13\",\"utxovout\":1,\"utxovalue\":100000000,\"txfee\":20000,\"method\":\"txblast\",\"coin\":\"PIZZA\",\"outputs\":[{\"RUgW6fLfVsLJ87Ng4zJTqNedJSKYQ9ToAf\":0.0001}, {\"RLMHGUQginEGrnRtHoFBPZhLC9jeVdt1th\":0.0001}]}" + From ed5dadcb99328277d51824bbc43851fd9c2ae68c Mon Sep 17 00:00:00 2001 From: SHossain Date: Sat, 21 Apr 2018 17:29:06 +0100 Subject: [PATCH 11/98] removed `run` so `install` should work --- iguana/exchanges/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 2137ab161..6eba8d22a 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp install updateprices get_supernet trackbtc auto_chipskmd auto_chipsbtc pendingswaps fundvalue balances dynamictrust getcoin kickstart tradesarray claim deposit10 deposit1 invreset sendrawtransaction processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client client_osx client_static run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp install updateprices get_supernet trackbtc auto_chipskmd auto_chipsbtc pendingswaps fundvalue balances dynamictrust getcoin kickstart tradesarray claim deposit10 deposit1 invreset sendrawtransaction processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client client_osx client_static coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . From acd424d58326e96d7261e64d9acf5438292966d7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Apr 2018 21:53:30 +0300 Subject: [PATCH 12/98] Skip coin add checks for txblast --- iguana/exchanges/LP_transaction.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 059463cee..681332c76 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1529,7 +1529,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx *changeoutp = -1; if ( coin == 0 || outputs == 0 || (numvouts= cJSON_GetArraySize(outputs)) <= 0 ) { - printf("LP_createrawtransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); + printf("LP_createblasttransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); return(0); } amount = txfee; @@ -1538,14 +1538,14 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx item = jitem(outputs,i); if ( (coinaddr= jfieldname(item)) != 0 ) { - if ( LP_address_isvalid(coin->symbol,coinaddr) <= 0 ) + if ( 0 && LP_address_isvalid(coin->symbol,coinaddr) <= 0 ) { - printf("%s LP_createrawtransaction %s i.%d of %d is invalid\n",coin->symbol,coinaddr,i,numvouts); + printf("%s LP_createblasttransaction %s i.%d of %d is invalid\n",coin->symbol,coinaddr,i,numvouts); return(0); } if ( (value= SATOSHIDEN * jdouble(item,coinaddr)) <= 0 ) { - printf("cant get value %s i.%d of %d %s\n",coinaddr,i,numvouts,jprint(outputs,0)); + printf("LP_createblasttransaction: cant get value %s i.%d of %d %s\n",coinaddr,i,numvouts,jprint(outputs,0)); return(0); } amount += value; @@ -1553,7 +1553,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx } else { - printf("cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + printf("LP_createblasttransaction: cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); return(0); } } @@ -1583,7 +1583,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx { if ( (value= SATOSHIDEN * jdouble(item,coinaddr)) <= 0 ) { - printf("cant get value i.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + printf("LP_createblasttransaction: cant get value i.%d of %d %s\n",i,numvouts,jprint(outputs,0)); free_json(txobj); return(0); } @@ -1597,7 +1597,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx } else { - printf("custom script.%d too long %d\n",i,spendlen); + printf("LP_createblasttransaction: custom script.%d too long %d\n",i,spendlen); free_json(txobj); return(0); } @@ -1618,7 +1618,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx } else { - printf("cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + printf("LP_createblasttransaction: cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); free_json(txobj); return(0); } @@ -1632,7 +1632,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx *changeoutp = numvouts; } if ( (rawtxbytes= bitcoin_json2hex(coin->symbol,coin->isPoS,&txid,txobj,V)) == 0 ) - printf("error making rawtx suppress.%d\n",suppress_pubkeys); + printf("LP_createblasttransaction: error making rawtx suppress.%d\n",suppress_pubkeys); *txobjp = txobj; return(rawtxbytes); } @@ -1670,10 +1670,10 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) memset(&msgtx,0,sizeof(msgtx)); memset(signedtxid.bytes,0,sizeof(signedtxid)); if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,&V,1,rawtx,vins,privkeys,coin->zcash)) < 0 ) - printf("couldnt sign withdraw %s\n",bits256_str(str,signedtxid)); + printf("LP_txblast: couldnt sign blast tx %s\n",bits256_str(str,signedtxid)); else if ( completed == 0 ) { - printf("incomplete signing withdraw (%s)\n",jprint(vins,0)); + printf("LP_txblast incomplete signing blast tx (%s)\n",jprint(vins,0)); break; } else @@ -1682,7 +1682,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) { if ( (signret= LP_sendrawtransaction(coin->symbol,signedtx)) != 0 ) { - printf("LP_txblast.%s broadcast (%s) vs %s\n",coin->symbol,bits256_str(str,signedtxid),signret); + //printf("LP_txblast.%s broadcast (%s) vs %s\n",coin->symbol,bits256_str(str,signedtxid),signret); if ( is_hexstr(signret,0) == 64 ) { decode_hex(checktxid.bytes,32,signret); From fafa06864d34318dff8307dff17e50d51b92e586 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 16:43:07 +0300 Subject: [PATCH 13/98] +error prints --- iguana/exchanges/LP_transaction.c | 32 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 681332c76..6a326ceba 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1529,7 +1529,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx *changeoutp = -1; if ( coin == 0 || outputs == 0 || (numvouts= cJSON_GetArraySize(outputs)) <= 0 ) { - printf("LP_createblasttransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); + fprintf(stderr,"LP_createblasttransaction: illegal coin.%p outputs.%p or arraysize.%d, error\n",coin,outputs,numvouts); return(0); } amount = txfee; @@ -1540,12 +1540,12 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx { if ( 0 && LP_address_isvalid(coin->symbol,coinaddr) <= 0 ) { - printf("%s LP_createblasttransaction %s i.%d of %d is invalid\n",coin->symbol,coinaddr,i,numvouts); + fprintf(stderr,"%s LP_createblasttransaction %s i.%d of %d is invalid\n",coin->symbol,coinaddr,i,numvouts); return(0); } if ( (value= SATOSHIDEN * jdouble(item,coinaddr)) <= 0 ) { - printf("LP_createblasttransaction: cant get value %s i.%d of %d %s\n",coinaddr,i,numvouts,jprint(outputs,0)); + fprintf(stderr,"LP_createblasttransaction: cant get value %s i.%d of %d %s\n",coinaddr,i,numvouts,jprint(outputs,0)); return(0); } amount += value; @@ -1553,7 +1553,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx } else { - printf("LP_createblasttransaction: cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + fprintf(stderr,"LP_createblasttransaction: cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); return(0); } } @@ -1583,7 +1583,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx { if ( (value= SATOSHIDEN * jdouble(item,coinaddr)) <= 0 ) { - printf("LP_createblasttransaction: cant get value i.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + fprintf(stderr,"LP_createblasttransaction: cant get value i.%d of %d %s\n",i,numvouts,jprint(outputs,0)); free_json(txobj); return(0); } @@ -1597,7 +1597,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx } else { - printf("LP_createblasttransaction: custom script.%d too long %d\n",i,spendlen); + fprintf(stderr,"LP_createblasttransaction: custom script.%d too long %d\n",i,spendlen); free_json(txobj); return(0); } @@ -1618,7 +1618,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx } else { - printf("LP_createblasttransaction: cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); + fprintf(stderr,"LP_createblasttransaction: cant get fieldname.%d of %d %s\n",i,numvouts,jprint(outputs,0)); free_json(txobj); return(0); } @@ -1632,7 +1632,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx *changeoutp = numvouts; } if ( (rawtxbytes= bitcoin_json2hex(coin->symbol,coin->isPoS,&txid,txobj,V)) == 0 ) - printf("LP_createblasttransaction: error making rawtx suppress.%d\n",suppress_pubkeys); + fprintf(stderr,"LP_createblasttransaction: error making rawtx suppress.%d\n",suppress_pubkeys); *txobjp = txobj; return(rawtxbytes); } @@ -1682,7 +1682,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) { if ( (signret= LP_sendrawtransaction(coin->symbol,signedtx)) != 0 ) { - //printf("LP_txblast.%s broadcast (%s) vs %s\n",coin->symbol,bits256_str(str,signedtxid),signret); + printf("LP_txblast.%s broadcast (%s) vs %s\n",coin->symbol,bits256_str(str,signedtxid),signret); if ( is_hexstr(signret,0) == 64 ) { decode_hex(checktxid.bytes,32,signret); @@ -1692,10 +1692,20 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) } else break; } else break; free(signret); - } else break; + } + else + { + fprintf(stderr,"null return from LP_sendrawtransaction\n"); + break; + } } else printf("blaster i.%d of %d: %s/v%d %.8f %s\n",i,numblast,bits256_str(str,signedtxid),changeout,dstr(change),signedtx); } - } else break; + } + else + { + fprintf(stderr,"error creating txblast rawtransaction\n"); + break; + } if ( txobj != 0 ) free_json(txobj), txobj = 0; if ( rawtx != 0 ) From 163cb4b8a7d90a294f4a127bd5c3a485e06df41d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:07:36 +0300 Subject: [PATCH 14/98] Test --- iguana/exchanges/LP_transaction.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6a326ceba..de87a2d13 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1690,7 +1690,12 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) { printf("blaster i.%d of %d: %s/v%d %.8f\n",i,numblast,bits256_str(str,signedtxid),changeout,dstr(change)); } else break; - } else break; + } + else + { + printf("error sending tx %s '[\"%s\"]'\n",rawtx,wifstr); + break; + } free(signret); } else From 1ef1793c8b335900c2b5175d5b896e07c0fe4f31 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:12:32 +0300 Subject: [PATCH 15/98] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index de87a2d13..64fc9bf5e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1693,7 +1693,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) } else { - printf("error sending tx %s '[\"%s\"]'\n",rawtx,wifstr); + printf("error sending tx:\n \"%s\" null '[\"%s\"]'\n",rawtx,wifstr); break; } free(signret); From def492fcfe2c2b48c7c3a238e0dffb8b16fa2991 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:31:15 +0300 Subject: [PATCH 16/98] bitcoin_signrawtransaction --- iguana/exchanges/LP_transaction.c | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 64fc9bf5e..f5a01a598 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1637,6 +1637,42 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx return(rawtxbytes); } +char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct iguana_info *coin,char *rawtx,char *wifstr) +{ + char *retstr,*paramstr,*nullarray,*signedtx = 0; cJSON *retjson,*array,*params,signedjson; + *completedp = 0; + memset(signedtxidp,0,sizeof(*signedtxidp)); + params = cJSON_CreateArray(); + jaddistr(params,rawtx); + nullarray = cJSON_CreateArray(); + jaddi(params,nullarray); + array = cJSON_CreateArray(); + jaddstr(array,wifstr); + paramstr = jprint(params,1); + if ( (retstr= bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"signrawtransaction",paramstr)) != 0 ) + { + if ( (signedjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (hexstr= jstr(json,"hex")) != 0 ) + { + len = (int32_t)strlen(hexstr); + signedtx = calloc(1,len+1); + strcpy(signedtx,hexstr); + *completedp = is_cJSON_True(jobj(json,"complete")); + len >>= 1; + data = malloc(len); + decode_hex(data,len,hexstr); + *signedtxidp = bits256_calctxid(coin->symbol,data,len); + free(data); + } + free_json(signedjson); + } + free(retstr); + } + free(paramstr); + return(signedtx); +} + char *LP_txblast(struct iguana_info *coin,cJSON *argjson) { static void *ctx; @@ -1669,7 +1705,8 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) completed = 0; memset(&msgtx,0,sizeof(msgtx)); memset(signedtxid.bytes,0,sizeof(signedtxid)); - if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,&V,1,rawtx,vins,privkeys,coin->zcash)) < 0 ) + if ( (signedtx= bitcoin_signrawtransaction(&completed,&signedtxidcoin,rawtx,wifstr)) == 0 ) + //if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,&V,1,rawtx,vins,privkeys,coin->zcash)) < 0 ) printf("LP_txblast: couldnt sign blast tx %s\n",bits256_str(str,signedtxid)); else if ( completed == 0 ) { From fe120f19fc6f08aedaf2838d5ef435a481e37a72 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:33:23 +0300 Subject: [PATCH 17/98] Test --- iguana/exchanges/LP_transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index f5a01a598..599e5776e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1639,7 +1639,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct iguana_info *coin,char *rawtx,char *wifstr) { - char *retstr,*paramstr,*nullarray,*signedtx = 0; cJSON *retjson,*array,*params,signedjson; + char *retstr,*paramstr,*hexstr,*signedtx = 0; int32_t len; uint8_t *data; cJSON *retjson,*array,*params,*signedjson,*nullarray; *completedp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); params = cJSON_CreateArray(); @@ -1653,7 +1653,7 @@ char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct { if ( (signedjson= cJSON_Parse(retstr)) != 0 ) { - if ( (hexstr= jstr(json,"hex")) != 0 ) + if ( (hexstr= jstr(signedjson,"hex")) != 0 ) { len = (int32_t)strlen(hexstr); signedtx = calloc(1,len+1); From cd752cba968b0801e58debc3f437284437a91ac1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:37:48 +0300 Subject: [PATCH 18/98] Test --- iguana/exchanges/LP_transaction.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 599e5776e..7b184ca84 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1639,7 +1639,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct iguana_info *coin,char *rawtx,char *wifstr) { - char *retstr,*paramstr,*hexstr,*signedtx = 0; int32_t len; uint8_t *data; cJSON *retjson,*array,*params,*signedjson,*nullarray; + char *retstr,*paramstr,*hexstr,*signedtx = 0; int32_t len; uint8_t *data; cJSON *array,*params,*signedjson,*nullarray; *completedp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); params = cJSON_CreateArray(); @@ -1647,7 +1647,7 @@ char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct nullarray = cJSON_CreateArray(); jaddi(params,nullarray); array = cJSON_CreateArray(); - jaddstr(array,wifstr); + jaddistr(array,wifstr); paramstr = jprint(params,1); if ( (retstr= bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"signrawtransaction",paramstr)) != 0 ) { @@ -1658,7 +1658,7 @@ char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct len = (int32_t)strlen(hexstr); signedtx = calloc(1,len+1); strcpy(signedtx,hexstr); - *completedp = is_cJSON_True(jobj(json,"complete")); + *completedp = is_cJSON_True(jobj(signedjson,"complete")); len >>= 1; data = malloc(len); decode_hex(data,len,hexstr); @@ -1705,7 +1705,7 @@ char *LP_txblast(struct iguana_info *coin,cJSON *argjson) completed = 0; memset(&msgtx,0,sizeof(msgtx)); memset(signedtxid.bytes,0,sizeof(signedtxid)); - if ( (signedtx= bitcoin_signrawtransaction(&completed,&signedtxidcoin,rawtx,wifstr)) == 0 ) + if ( (signedtx= bitcoin_signrawtransaction(&completed,&signedtxid,coin,rawtx,wifstr)) == 0 ) //if ( (completed= iguana_signrawtransaction(ctx,coin->symbol,coin->wiftaddr,coin->taddr,coin->pubtype,coin->p2shtype,coin->isPoS,coin->longestchain,&msgtx,&signedtx,&signedtxid,&V,1,rawtx,vins,privkeys,coin->zcash)) < 0 ) printf("LP_txblast: couldnt sign blast tx %s\n",bits256_str(str,signedtxid)); else if ( completed == 0 ) From 5f59d6674ff3332f796dffd8dbec9b050649ab0c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:40:00 +0300 Subject: [PATCH 19/98] Test --- iguana/exchanges/LP_transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 7b184ca84..a69e9015d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1651,6 +1651,7 @@ char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct paramstr = jprint(params,1); if ( (retstr= bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"signrawtransaction",paramstr)) != 0 ) { + printf("signed -> %s\n",retstr); if ( (signedjson= cJSON_Parse(retstr)) != 0 ) { if ( (hexstr= jstr(signedjson,"hex")) != 0 ) From 7a50da98954bba452b612d5257f2bbcf34da37b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:45:28 +0300 Subject: [PATCH 20/98] Test --- iguana/exchanges/LP_transaction.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index a69e9015d..3eb4614e3 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1639,19 +1639,14 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct iguana_info *coin,char *rawtx,char *wifstr) { - char *retstr,*paramstr,*hexstr,*signedtx = 0; int32_t len; uint8_t *data; cJSON *array,*params,*signedjson,*nullarray; + char *retstr,*paramstr,*hexstr,*signedtx = 0; int32_t len; uint8_t *data; cJSON *signedjson; *completedp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); - params = cJSON_CreateArray(); - jaddistr(params,rawtx); - nullarray = cJSON_CreateArray(); - jaddi(params,nullarray); - array = cJSON_CreateArray(); - jaddistr(array,wifstr); - paramstr = jprint(params,1); + paramstr = calloc(1,200000+1); + sprintf(paramstr,"[\"%s\", 0, [\"%s\"]]",rawtx,wifstr); if ( (retstr= bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"signrawtransaction",paramstr)) != 0 ) { - printf("signed -> %s\n",retstr); + printf("%s signed -> %s\n",coin->symbol,retstr); if ( (signedjson= cJSON_Parse(retstr)) != 0 ) { if ( (hexstr= jstr(signedjson,"hex")) != 0 ) From afe332fd94ad0e09ae3722620fb6d6743c3a58bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:50:30 +0300 Subject: [PATCH 21/98] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 3eb4614e3..d7561bb72 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1643,7 +1643,7 @@ char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct *completedp = 0; memset(signedtxidp,0,sizeof(*signedtxidp)); paramstr = calloc(1,200000+1); - sprintf(paramstr,"[\"%s\", 0, [\"%s\"]]",rawtx,wifstr); + sprintf(paramstr,"[\"%s\", null, [\"%s\"]]",rawtx,wifstr); if ( (retstr= bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"signrawtransaction",paramstr)) != 0 ) { printf("%s signed -> %s\n",coin->symbol,retstr); From 220ced0ad3438bae356a4e1e04b3e641258665a9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Apr 2018 18:55:15 +0300 Subject: [PATCH 22/98] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index d7561bb72..b67ca1984 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1646,7 +1646,7 @@ char *bitcoin_signrawtransaction(int32_t *completedp,bits256 *signedtxidp,struct sprintf(paramstr,"[\"%s\", null, [\"%s\"]]",rawtx,wifstr); if ( (retstr= bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"signrawtransaction",paramstr)) != 0 ) { - printf("%s signed -> %s\n",coin->symbol,retstr); + //printf("%s signed -> %s\n",coin->symbol,retstr); if ( (signedjson= cJSON_Parse(retstr)) != 0 ) { if ( (hexstr= jstr(signedjson,"hex")) != 0 ) From d0596a706845ad4c0445431d2edf2b1af6857c69 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Apr 2018 10:36:22 +0300 Subject: [PATCH 23/98] Change to blastaddr --- iguana/exchanges/LP_transaction.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index b67ca1984..21ee26776 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1521,7 +1521,7 @@ char *LP_opreturndecrypt(void *ctx,char *symbol,bits256 utxotxid,char *passphras char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **txobjp,cJSON **vinsp,struct vin_info *V,struct iguana_info *coin,bits256 utxotxid,int32_t utxovout,uint64_t utxovalue,bits256 privkey,cJSON *outputs,int64_t txfee) { static void *ctx; - cJSON *txobj,*item,*vins; uint8_t addrtype,rmd160[20],data[8192+64],script[8192],spendscript[256]; char *coinaddr,*rawtxbytes,*scriptstr,spendscriptstr[128],wifstr[64]; bits256 txid; uint32_t locktime,crc32,timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,offset,len,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0; + cJSON *txobj,*item,*vins; uint8_t addrtype,rmd160[20],pubkey33[33],tmptype,data[8192+64],script[8192],spendscript[256]; char *coinaddr,*rawtxbytes,*scriptstr,spendscriptstr[128],blastaddr[64],wifstr[64]; bits256 txid; uint32_t locktime,crc32,timestamp; int64_t change=0,adjust=0,total,value,amount = 0; int32_t i,offset,len,scriptlen,spendlen,suppress_pubkeys,ignore_cltverr,numvouts=0; if ( ctx == 0 ) ctx = bitcoin_ctx(); *txobjp = *vinsp = 0; @@ -1563,13 +1563,15 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx V->N = V->M = 1; V->signers[0].privkey = privkey; bitcoin_priv2wif(coin->symbol,coin->wiftaddr,wifstr,privkey,coin->wiftype); + bitcoin_priv2pub(ctx,coin->symbol,pubkey33,blastaddr,privkey,coin->taddr,coin->pubtype); + bitcoin_addr2rmd160("KMD",taddr,&tmptype,rmd160,blastaddr); V->suppress_pubkeys = suppress_pubkeys; V->ignore_cltverr = ignore_cltverr; change = (utxovalue - amount); timestamp = (uint32_t)time(NULL); locktime = 0; txobj = bitcoin_txcreate(coin->symbol,coin->isPoS,locktime,coin->txversion,timestamp); - scriptlen = bitcoin_standardspend(script,0,G.LP_myrmd160); + scriptlen = bitcoin_standardspend(script,0,rmd160); init_hexbytes_noT(spendscriptstr,script,scriptlen); vins = cJSON_CreateArray(); jaddi(vins,LP_inputjson(utxotxid,utxovout,spendscriptstr)); From 4dd420f77fccd481ce8112594209c23409d2f188 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Apr 2018 10:37:46 +0300 Subject: [PATCH 24/98] Test --- iguana/exchanges/LP_transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 21ee26776..5d6a9b40d 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1564,7 +1564,7 @@ char *LP_createblasttransaction(uint64_t *changep,int32_t *changeoutp,cJSON **tx V->signers[0].privkey = privkey; bitcoin_priv2wif(coin->symbol,coin->wiftaddr,wifstr,privkey,coin->wiftype); bitcoin_priv2pub(ctx,coin->symbol,pubkey33,blastaddr,privkey,coin->taddr,coin->pubtype); - bitcoin_addr2rmd160("KMD",taddr,&tmptype,rmd160,blastaddr); + bitcoin_addr2rmd160("KMD",coin->taddr,&tmptype,rmd160,blastaddr); V->suppress_pubkeys = suppress_pubkeys; V->ignore_cltverr = ignore_cltverr; change = (utxovalue - amount); From a7ee6ca02f3371540cae138d5a79ee0b41670d84 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Apr 2018 22:39:31 +0300 Subject: [PATCH 25/98] +GLXT --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 88e019718..effe9c449 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"PYRO\",\"name\":\"pyro\",\"confpath\":\"${HOME#}/.pyrocore/pyro.conf\",\"rpcport\":9696,\"pubtype\":55,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\": \"BNTN\",\"asset\": \"BNTN\",\"rpcport\": 14358},{\"coin\":\"ORE\",\"name\":\"galactrum\",\"rpcport\":6269,\"pubtype\":38,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELD\",\"name\":\"maker\",\"etomic\":\"0xaaf7d4cd097317d68174215395eb02c2cca81e31\",\"rpcport\":80}, {\"coin\":\"CENNZ\",\"name\":\"centrality\",\"etomic\":\"0x1122b6a0e00dce0563082b6e2953f3a943855c1f\",\"rpcport\":80}, {\"coin\":\"PGN\",\"name\":\"pigeon\",\"rpcport\":8756,\"pubtype\":55,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCG\",\"name\":\"Xchange\",\"confpath\":\"${HOME#}/.Xchangecore/Xchange.conf\",\"rpcport\":9386,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"AXE\",\"name\":\"axe\",\"confpath\":\"${HOME#}/.axecore/axe.conf\",\"rpcport\":9337,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"PEW\",\"name\":\"brofist\",\"rpcport\":12454,\"pubtype\":55,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000,\"confpath\":\"${HOME#}/.brofistcore/brofist.conf\"}, {\"coin\":\"BCBC\",\"name\":\"bitcoin@cbc\",\"confpath\":\"${HOME#}/.bitcoin@cbc/bitcoin.conf\",\"rpcport\":8340,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"GRLC\",\"name\":\"garlicoin\",\"rpcport\":42068,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"EQL\",\"asset\":\"EQL\",\"rpcport\":10306}, {\"coin\":\"OCC\",\"name\":\"originalcryptocoin\",\"etomic\":\"0x0235fe624e044a05eed7a43e16e3083bc8a4287a\",\"rpcport\":80}, {\"coin\":\"DIN\",\"name\":\"dinero\",\"rpcport\":9998,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":204,\"txfee\":10000,\"confpath\":\"${HOME#}/.dinerocore/dinero.conf\"}, {\"coin\":\"BUCK\",\"name\":\"buck\",\"rpcport\":5739,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LYS\",\"name\":\"lightyears\",\"etomic\":\"0xdd41fbd1ae95c5d9b198174a28e04be6b3d1aa27\",\"rpcport\":80}, {\"coin\":\"RAP\",\"name\":\"rapture\",\"rpcport\":14776,\"pubtype\":60,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000,\"confpath\":\"${HOME#}/.rapturecore/rapture.conf\"}, {\"coin\":\"RADIUS\",\"name\":\"radius\",\"rpcport\":4089,\"pubtype\":60,\"p2shtype\":16,\"wiftype\":15,\"txfee\":10000,\"confpath\":\"${HOME#}/.radiuscore/radius.conf\"},{\"coin\":\"BTCL\",\"name\":\"btclite\",\"etomic\":\"0x5acd19b9c91e596b1f062f18e3d02da7ed8d1e50\",\"rpcport\":80}, {\"coin\":\"SEQ\",\"name\":\"sequence\",\"rpcport\":16663,\"isPoS\":1,\"pubtype\":63,\"p2shtype\":64,\"wiftype\":170,\"txfee\":10000}, {\"coin\":\"DYN\",\"name\":\"dynamic\",\"rpcport\":33350,\"pubtype\":30,\"p2shtype\":10,\"wiftype\":140,\"txfee\":10000}, {\"coin\":\"SBTC\",\"name\":\"SuperBitcoin\",\"rpcport\":28282,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000,\"confpath\":\"${HOME#}/.sbtc/sbtc.conf\"}, {\"coin\":\"FJC\",\"name\":\"fujicoin\",\"rpcport\":3776,\"pubtype\":36,\"p2shtype\":16,\"wiftype\":164,\"txfee\":100000}, {\"coin\":\"AIR\",\"name\":\"airtoken\",\"etomic\":\"0x27dce1ec4d3f72c3e457cc50354f1f975ddef488\",\"rpcport\":80}, {\"coin\":\"VRT\",\"name\":\"virtus\",\"confpath\":\"${HOME#}/.virtuscore/virtus.conf\",\"rpcport\":13880,\"pubtype\":70,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"DRT\",\"name\":\"domraider\",\"etomic\":\"0x9af4f26941677c706cfecf6d3379ff01bb85d5ab\",\"rpcport\":80}, {\"coin\":\"BITS\",\"name\":\"bitstar\",\"rpcport\":15715,\"isPoS\":1,\"pubtype\":25,\"p2shtype\":8,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"FTC\",\"name\":\"feathercoin\",\"rpcport\":9337,\"pubtype\":14,\"p2shtype\":5,\"wiftype\":142,\"txfee\":1000000}, {\"coin\":\"PXT\",\"name\":\"populous-xbrl-token\",\"etomic\":\"0xc14830e53aa344e8c14603a91229a0b925b0b262\",\"rpcport\":80}, {\"coin\":\"USDT\",\"name\":\"tether\",\"etomic\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"rpcport\":80}, {\"coin\":\"ELI\",\"name\":\"elicoin\",\"rpcport\":9332,\"pubtype\":33,\"p2shtype\":102,\"wiftype\":205,\"txfee\":10000}, {\"coin\":\"SCRIV\",\"name\":\"scriv\",\"confpath\":\"${HOME#}/.scrivcore/scriv.conf\",\"rpcport\":7998,\"pubtype\":125,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELP\",\"name\":\"ellerium\",\"rpcport\":61020,\"pubtype\":23,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"ROI\",\"name\":\"ROIcoin\",\"rpcport\":3376,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCOIN\",\"name\":\"xcoin\",\"rpcport\":22717,\"pubtype\":137,\"p2shtype\":15,\"wiftype\":75,\"txfee\":100000}, {\"coin\":\"BBT\",\"name\":\"bitboost\",\"etomic\":\"0x1500205f50bf3fd976466d0662905c9ff254fc9c\",\"rpcport\":80}, {\"coin\":\"TRX\",\"name\":\"tron\",\"etomic\":\"0xf230b790e05390fc8295f4d3f60332c93bed42e2\",\"rpcport\":80}, {\"coin\":\"OMG\",\"name\":\"omisego\",\"etomic\":\"0xd26114cd6EE289AccF82350c8d8487fedB8A0C07\",\"rpcport\":80}, {\"coin\":\"ICX\",\"name\":\"icon\",\"etomic\":\"0xb5a5f22694352c15b00323844ad545abb2b11028\",\"rpcport\":80}, {\"coin\":\"BNB\",\"name\":\"binance-coin\",\"etomic\":\"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\"rpcport\":80}, {\"coin\":\"DGD\",\"name\":\"digixdao\",\"etomic\":\"0xE0B7927c4aF23765Cb51314A0E0521A9645F0E2A\",\"rpcport\":80}, {\"coin\":\"PPT\",\"name\":\"populous\",\"etomic\":\"0xd4fa1460F537bb9085d22C7bcCB5DD450Ef28e3a\",\"rpcport\":80}, {\"coin\":\"MKR\",\"name\":\"maker\",\"etomic\":\"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2\",\"rpcport\":80}, {\"coin\":\"SNT\",\"name\":\"status\",\"etomic\":\"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E\",\"rpcport\":80}, {\"coin\":\"REP\",\"name\":\"augur\",\"etomic\":\"0xE94327D07Fc17907b4DB788E5aDf2ed424adDff6\",\"rpcport\":80}, {\"coin\":\"ZRX\",\"name\":\"0x\",\"etomic\":\"0xE41d2489571d322189246DaFA5ebDe1F4699F498\",\"rpcport\":80}, {\"coin\":\"BAT\",\"name\":\"basic-attention-token\",\"etomic\":\"0x0D8775F648430679A709E98d2b0Cb6250d2887EF\",\"rpcport\":80}, {\"coin\":\"GNT\",\"name\":\"golem\",\"etomic\":\"0xa74476443119A942dE498590Fe1f2454d7D4aC0d\",\"rpcport\":80}, {\"coin\":\"ETHOS\",\"name\":\"ethos\",\"etomic\":\"0x5Af2Be193a6ABCa9c8817001F45744777Db30756\",\"rpcport\":80}, {\"coin\":\"QASH\",\"name\":\"qash\",\"etomic\":\"0x618E75Ac90b12c6049Ba3b27f5d5F8651b0037F6\",\"rpcport\":80}, {\"coin\":\"FUN\",\"name\":\"funfair\",\"etomic\":\"0x419D0d8BdD9aF5e606Ae2232ed285Aff190E711b\",\"rpcport\":80}, {\"coin\":\"KNC\",\"name\":\"kyber-network\",\"etomic\":\"0xdd974D5C2e2928deA5F71b9825b8b646686BD200\",\"rpcport\":80}, {\"coin\":\"SALT\",\"name\":\"salt\",\"etomic\":\"0x4156D3342D5c385a87D264F90653733592000581\",\"rpcport\":80}, {\"coin\":\"BNT\",\"name\":\"bancor\",\"etomic\":\"0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C\",\"rpcport\":80}, {\"coin\":\"ICN\",\"name\":\"iconomi\",\"etomic\":\"0x888666CA69E0f178DED6D75b5726Cee99A87D698\",\"rpcport\":80}, {\"coin\":\"PAY\",\"name\":\"tenx\",\"etomic\":\"0xB97048628DB6B661D4C2aA833e95Dbe1A905B280\",\"rpcport\":80}, {\"coin\":\"REQ\",\"name\":\"request-network\",\"etomic\":\"0x8f8221aFbB33998d8584A2B05749bA73c37a938a\",\"rpcport\":80}, {\"coin\":\"STORJ\",\"name\":\"storj\",\"etomic\":\"0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC\",\"rpcport\":80}, {\"coin\":\"GNO\",\"name\":\"gnosis-gno\",\"etomic\":\"0x6810e776880C02933D47DB1b9fc05908e5386b96\",\"rpcport\":80}, {\"coin\":\"RLC\",\"name\":\"rlc\",\"etomic\":\"0x607F4C5BB672230e8672085532f7e901544a7375\",\"rpcport\":80}, {\"coin\":\"ENJ\",\"name\":\"enjin-coin\",\"etomic\":\"0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c\",\"rpcport\":80}, {\"coin\":\"QSP\",\"name\":\"quantstamp\",\"etomic\":\"0x99ea4dB9EE77ACD40B119BD1dC4E33e1C070b80d\",\"rpcport\":80}, {\"coin\":\"RDN\",\"name\":\"raiden-network-token\",\"etomic\":\"0x255Aa6DF07540Cb5d3d297f0D0D4D84cb52bc8e6\",\"rpcport\":80}, {\"coin\":\"CVC\",\"name\":\"civic\",\"etomic\":\"0x41e5560054824eA6B0732E656E3Ad64E20e94E45\",\"rpcport\":80}, {\"coin\":\"SAN\",\"name\":\"santiment\",\"etomic\":\"0x7C5A0CE9267ED19B22F8cae653F198e3E8daf098\",\"rpcport\":80}, {\"coin\":\"ANT\",\"name\":\"aragon\",\"etomic\":\"0x960b236A07cf122663c4303350609A66A7B288C0\",\"rpcport\":80}, {\"coin\":\"MANA\",\"name\":\"decentraland\",\"etomic\":\"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942\",\"rpcport\":80}, {\"coin\":\"MCO\",\"name\":\"monaco\",\"etomic\":\"0xB63B606Ac810a52cCa15e44bB630fd42D8d1d83d\",\"rpcport\":80}, {\"coin\":\"MTL\",\"name\":\"metal\",\"etomic\":\"0xF433089366899D83a9f26A773D59ec7eCF30355e\",\"rpcport\":80}, {\"coin\":\"EDG\",\"name\":\"edgeless\",\"etomic\":\"0x08711D3B02C8758F2FB3ab4e80228418a7F8e39c\",\"rpcport\":80}, {\"coin\":\"MLN\",\"name\":\"melon\",\"etomic\":\"0xBEB9eF514a379B997e0798FDcC901Ee474B6D9A1\",\"rpcport\":80}, {\"coin\":\"AMB\",\"name\":\"amber\",\"etomic\":\"0x4DC3643DbC642b72C158E7F3d2ff232df61cb6CE\",\"rpcport\":80}, {\"coin\":\"WINGS\",\"name\":\"wings\",\"etomic\":\"0x667088b212ce3d06a1b553a7221E1fD19000d9aF\",\"rpcport\":80}, {\"coin\":\"RCN\",\"name\":\"ripio-credit-network\",\"etomic\":\"0xF970b8E36e23F7fC3FD752EeA86f8Be8D83375A6\",\"rpcport\":80}, {\"coin\":\"SNGLS\",\"name\":\"singulardtv\",\"etomic\":\"0xaeC2E87E0A235266D9C5ADc9DEb4b2E29b54D009\",\"rpcport\":80}, {\"coin\":\"TAAS\",\"name\":\"taas\",\"etomic\":\"0xE7775A6e9Bcf904eb39DA2b68c5efb4F9360e08C\",\"rpcport\":80}, {\"coin\":\"DNT\",\"name\":\"district0x\",\"etomic\":\"0x0AbdAce70D3790235af448C88547603b945604ea\",\"rpcport\":80}, {\"coin\":\"CFI\",\"name\":\"cofound-it\",\"etomic\":\"0x12FEF5e57bF45873Cd9B62E9DBd7BFb99e32D73e\",\"rpcport\":80}, {\"coin\":\"LUN\",\"name\":\"lunyr\",\"etomic\":\"0xfa05A73FfE78ef8f1a739473e462c54bae6567D9\",\"rpcport\":80}, {\"coin\":\"ADT\",\"name\":\"adtoken\",\"etomic\":\"0xD0D6D6C5Fe4a677D343cC433536BB717bAe167dD\",\"rpcport\":80}, {\"coin\":\"AST\",\"name\":\"airswap\",\"etomic\":\"0x27054b13b1B798B345b591a4d22e6562d47eA75a\",\"rpcport\":80}, {\"coin\":\"CDT\",\"name\":\"blox\",\"etomic\":\"0x177d39AC676ED1C67A2b268AD7F1E58826E5B0af\",\"rpcport\":80}, {\"coin\":\"TKN\",\"name\":\"tokencard\",\"etomic\":\"0xaAAf91D9b90dF800Df4F55c205fd6989c977E73a\",\"rpcport\":80}, {\"coin\":\"HMQ\",\"name\":\"humaniq\",\"etomic\":\"0xcbCC0F036ED4788F63FC0fEE32873d6A7487b908\",\"rpcport\":80}, {\"coin\":\"BCAP\",\"name\":\"bcap\",\"etomic\":\"0xFf3519eeeEA3e76F1F699CCcE5E23ee0bdDa41aC\",\"rpcport\":80}, {\"coin\":\"NMR\",\"name\":\"numeraire\",\"etomic\":\"0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671\",\"rpcport\":80}, {\"coin\":\"NET\",\"name\":\"nimiq\",\"etomic\":\"0xcfb98637bcae43C13323EAa1731cED2B716962fD\",\"rpcport\":80}, {\"coin\":\"TRST\",\"name\":\"trust\",\"etomic\":\"0xCb94be6f13A1182E4A4B6140cb7bf2025d28e41B\",\"rpcport\":80}, {\"coin\":\"GUP\",\"name\":\"guppy\",\"etomic\":\"0xf7B098298f7C69Fc14610bf71d5e02c60792894C\",\"rpcport\":80}, {\"coin\":\"1ST\",\"name\":\"firstblood\",\"etomic\":\"0xAf30D2a7E90d7DC361c8C4585e9BB7D2F6f15bc7\",\"rpcport\":80}, {\"coin\":\"TIME\",\"name\":\"chronobank\",\"etomic\":\"0x6531f133e6DeeBe7F2dcE5A0441aA7ef330B4e53\",\"rpcport\":80}, {\"coin\":\"SWT\",\"name\":\"swarm-city\",\"etomic\":\"0xB9e7F8568e08d5659f5D29C4997173d84CdF2607\",\"rpcport\":80}, {\"coin\":\"ROL\",\"name\":\"dice\",\"etomic\":\"0x2e071D2966Aa7D8dECB1005885bA1977D6038A65\",\"rpcport\":80}, {\"coin\":\"XAUR\",\"name\":\"xaurum\",\"etomic\":\"0x4DF812F6064def1e5e029f1ca858777CC98D2D81\",\"rpcport\":80}, {\"coin\":\"PLU\",\"name\":\"pluton\",\"etomic\":\"0xD8912C10681D8B21Fd3742244f44658dBA12264E\",\"rpcport\":80}, {\"coin\":\"HGT\",\"name\":\"hellogold\",\"etomic\":\"0xba2184520A1cC49a6159c57e61E1844E085615B6\",\"rpcport\":80}, {\"coin\":\"VSL\",\"name\":\"vslice\",\"etomic\":\"0x5c543e7AE0A1104f78406C340E9C64FD9fCE5170\",\"rpcport\":80}, {\"coin\":\"IND\",\"name\":\"indorse-token\",\"etomic\":\"0xf8e386EDa857484f5a12e4B5DAa9984E06E73705\",\"rpcport\":80}, {\"coin\":\"FYN\",\"name\":\"fundyourselfnow\",\"etomic\":\"0x88FCFBc22C6d3dBaa25aF478C578978339BDe77a\",\"rpcport\":80},{\"coin\":\"SMART\",\"name\":\"smartcash\",\"rpcport\":9679,\"pubtype\":63,\"p2shtype\":18,\"wiftype\":191,\"txfee\":200000}, {\"coin\":\"BTCP\",\"name\":\"btcprivate\",\"rpcport\":7932,\"taddr\":19,\"pubtype\":37,\"p2shtype\":175,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DNR\",\"isPoS\":1,\"active\":1,\"name\":\"denarius\",\"rpcport\":32339,\"pubtype\":30,\"p2shtype\":90,\"wiftype\":158,\"txfee\":10000}, {\"coin\":\"RVN\",\"name\":\"raven\",\"rpcport\":8766,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"VIVO\",\"name\":\"vivo\",\"confpath\":\"${HOME#}/.vivocore/vivo.conf\",\"rpcport\":9998,\"pubtype\":70,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"KNG\",\"name\":\"kings\",\"rpcport\":44888,\"pubtype\":75,\"p2shtype\":125,\"wiftype\":203,\"txfee\":10000}, {\"coin\":\"UFO\",\"name\":\"ufocoin\",\"confpath\":\"${HOME#}/.ufo/ufocoin.conf\",\"rpcport\":9888,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":155,\"txfee\":100000}, {\"coin\":\"ETH\",\"name\":\"ethereum\",\"etomic\":\"0x0000000000000000000000000000000000000000\",\"rpcport\":80}, {\"coin\":\"EOS\",\"name\":\"EOS\",\"etomic\":\"0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0\",\"rpcport\":80}, {\"coin\":\"KREDS\",\"name\":\"kreds\",\"rpcport\":3850,\"pubtype\":45,\"p2shtype\":5,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"SNG\",\"name\":\"snowgem\",\"rpcport\":16112,\"taddr\":28,\"pubtype\":40,\"p2shtype\":45,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"ZEL\",\"name\":\"zelcash\",\"rpcport\":16124,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"HTML\",\"name\":\"htmlcoin\",\"rpcport\":4889,\"pubtype\":41,\"p2shtype\":100,\"wiftype\":169,\"txfee\":400000}, {\"coin\":\"MNX\",\"name\":\"Minexcoin\",\"rpcport\":17786,\"pubtype\":75,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LTZ\",\"name\":\"litecoinz\",\"rpcport\":29332,\"taddr\":10,\"pubtype\":179,\"p2shtype\":184,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BAY\",\"name\":\"bitbay\",\"isPoS\":1,\"rpcport\":19915,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"OOT\",\"asset\":\"OOT\",\"rpcport\":12467}, {\"coin\":\"ZOI\",\"name\":\"zoin\",\"rpcport\":8255,\"pubtype\":80,\"p2shtype\":7,\"wiftype\":208,\"txfee\":1000}, {\"coin\": \"PIZZA\",\"asset\": \"PIZZA\",\"rpcport\": 11116},{\"coin\": \"BEER\",\"asset\": \"BEER\",\"rpcport\": 8923}, {\"coin\":\"GRS\",\"name\":\"groestlcoin\",\"rpcport\":1441,\"pubtype\":36,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XMCC\",\"name\":\"monoeci\",\"confpath\":\"${HOME#}/.monoeciCore/monoeci.conf\",\"rpcport\":24156,\"pubtype\":50,\"p2shtype\":73,\"wiftype\":77,\"txfee\":10000}, {\"coin\":\"BTCH\",\"asset\":\"BTCH\",\"rpcport\":8800},{\"coin\":\"ETOMIC\",\"asset\":\"ETOMIC\",\"rpcport\":10271},{\"coin\":\"AXO\",\"asset\":\"AXO\",\"rpcport\":12927},{\"coin\":\"CRC\",\"name\":\"crowdcoin\",\"confpath\":\"${HOME#}/.crowdcoincore/crowdcoin.conf\",\"rpcport\":11998,\"pubtype\":28,\"p2shtype\":88,\"wiftype\":0,\"txfee\":10000}, {\"coin\":\"VOT\",\"name\":\"votecoin\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"INN\",\"name\":\"innova\",\"confpath\":\"${HOME#}/.innovacore/innova.conf\",\"rpcport\":8818,\"pubtype\":102,\"p2shtype\":20,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":28,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"EFL\",\"name\":\"egulden\",\"confpath\":\"${HOME#}/.egulden/coin.conf\",\"rpcport\":21015,\"pubtype\":48,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"GBX\",\"name\":\"gobyte\",\"confpath\":\"${HOME#}/.gobytecore/gobyte.conf\",\"rpcport\":12454,\"pubtype\":38,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"BCO\",\"name\":\"bridgecoin\",\"rpcport\":6332,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"confpath\":\"${HOME#}/.lore/blackcoin.conf\",\"isPoS\":1,\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":100000}, {\"coin\":\"BTG\",\"name\":\"bitcoingold\",\"rpcport\":8332,\"pubtype\":38,\"p2shtype\":23,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BCH\",\"name\":\"bch\",\"rpcport\":33333,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"ABY\",\"name\":\"applebyte\",\"rpcport\":8607,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":100000}, {\"coin\":\"STAK\",\"name\":\"straks\",\"rpcport\":7574,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"XZC\",\"name\":\"zcoin\",\"rpcport\":8888,\"pubtype\":82,\"p2shtype\":7,\"wiftype\":210,\"txfee\":10000}, {\"coin\":\"QTUM\",\"name\":\"qtum\",\"rpcport\":3889,\"pubtype\":58,\"p2shtype\":50,\"wiftype\":128,\"txfee\":400000}, {\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":100000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":10000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"MSHARK\",\"asset\":\"MSHARK\",\"rpcport\":8846}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{"coin":"GLXT","asset":"GLXT","rpcport":15723}, {\"coin\":\"PYRO\",\"name\":\"pyro\",\"confpath\":\"${HOME#}/.pyrocore/pyro.conf\",\"rpcport\":9696,\"pubtype\":55,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\": \"BNTN\",\"asset\": \"BNTN\",\"rpcport\": 14358},{\"coin\":\"ORE\",\"name\":\"galactrum\",\"rpcport\":6269,\"pubtype\":38,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELD\",\"name\":\"maker\",\"etomic\":\"0xaaf7d4cd097317d68174215395eb02c2cca81e31\",\"rpcport\":80}, {\"coin\":\"CENNZ\",\"name\":\"centrality\",\"etomic\":\"0x1122b6a0e00dce0563082b6e2953f3a943855c1f\",\"rpcport\":80}, {\"coin\":\"PGN\",\"name\":\"pigeon\",\"rpcport\":8756,\"pubtype\":55,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCG\",\"name\":\"Xchange\",\"confpath\":\"${HOME#}/.Xchangecore/Xchange.conf\",\"rpcport\":9386,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"AXE\",\"name\":\"axe\",\"confpath\":\"${HOME#}/.axecore/axe.conf\",\"rpcport\":9337,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"PEW\",\"name\":\"brofist\",\"rpcport\":12454,\"pubtype\":55,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000,\"confpath\":\"${HOME#}/.brofistcore/brofist.conf\"}, {\"coin\":\"BCBC\",\"name\":\"bitcoin@cbc\",\"confpath\":\"${HOME#}/.bitcoin@cbc/bitcoin.conf\",\"rpcport\":8340,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"GRLC\",\"name\":\"garlicoin\",\"rpcport\":42068,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"EQL\",\"asset\":\"EQL\",\"rpcport\":10306}, {\"coin\":\"OCC\",\"name\":\"originalcryptocoin\",\"etomic\":\"0x0235fe624e044a05eed7a43e16e3083bc8a4287a\",\"rpcport\":80}, {\"coin\":\"DIN\",\"name\":\"dinero\",\"rpcport\":9998,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":204,\"txfee\":10000,\"confpath\":\"${HOME#}/.dinerocore/dinero.conf\"}, {\"coin\":\"BUCK\",\"name\":\"buck\",\"rpcport\":5739,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LYS\",\"name\":\"lightyears\",\"etomic\":\"0xdd41fbd1ae95c5d9b198174a28e04be6b3d1aa27\",\"rpcport\":80}, {\"coin\":\"RAP\",\"name\":\"rapture\",\"rpcport\":14776,\"pubtype\":60,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000,\"confpath\":\"${HOME#}/.rapturecore/rapture.conf\"}, {\"coin\":\"RADIUS\",\"name\":\"radius\",\"rpcport\":4089,\"pubtype\":60,\"p2shtype\":16,\"wiftype\":15,\"txfee\":10000,\"confpath\":\"${HOME#}/.radiuscore/radius.conf\"},{\"coin\":\"BTCL\",\"name\":\"btclite\",\"etomic\":\"0x5acd19b9c91e596b1f062f18e3d02da7ed8d1e50\",\"rpcport\":80}, {\"coin\":\"SEQ\",\"name\":\"sequence\",\"rpcport\":16663,\"isPoS\":1,\"pubtype\":63,\"p2shtype\":64,\"wiftype\":170,\"txfee\":10000}, {\"coin\":\"DYN\",\"name\":\"dynamic\",\"rpcport\":33350,\"pubtype\":30,\"p2shtype\":10,\"wiftype\":140,\"txfee\":10000}, {\"coin\":\"SBTC\",\"name\":\"SuperBitcoin\",\"rpcport\":28282,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000,\"confpath\":\"${HOME#}/.sbtc/sbtc.conf\"}, {\"coin\":\"FJC\",\"name\":\"fujicoin\",\"rpcport\":3776,\"pubtype\":36,\"p2shtype\":16,\"wiftype\":164,\"txfee\":100000}, {\"coin\":\"AIR\",\"name\":\"airtoken\",\"etomic\":\"0x27dce1ec4d3f72c3e457cc50354f1f975ddef488\",\"rpcport\":80}, {\"coin\":\"VRT\",\"name\":\"virtus\",\"confpath\":\"${HOME#}/.virtuscore/virtus.conf\",\"rpcport\":13880,\"pubtype\":70,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"DRT\",\"name\":\"domraider\",\"etomic\":\"0x9af4f26941677c706cfecf6d3379ff01bb85d5ab\",\"rpcport\":80}, {\"coin\":\"BITS\",\"name\":\"bitstar\",\"rpcport\":15715,\"isPoS\":1,\"pubtype\":25,\"p2shtype\":8,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"FTC\",\"name\":\"feathercoin\",\"rpcport\":9337,\"pubtype\":14,\"p2shtype\":5,\"wiftype\":142,\"txfee\":1000000}, {\"coin\":\"PXT\",\"name\":\"populous-xbrl-token\",\"etomic\":\"0xc14830e53aa344e8c14603a91229a0b925b0b262\",\"rpcport\":80}, {\"coin\":\"USDT\",\"name\":\"tether\",\"etomic\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"rpcport\":80}, {\"coin\":\"ELI\",\"name\":\"elicoin\",\"rpcport\":9332,\"pubtype\":33,\"p2shtype\":102,\"wiftype\":205,\"txfee\":10000}, {\"coin\":\"SCRIV\",\"name\":\"scriv\",\"confpath\":\"${HOME#}/.scrivcore/scriv.conf\",\"rpcport\":7998,\"pubtype\":125,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELP\",\"name\":\"ellerium\",\"rpcport\":61020,\"pubtype\":23,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"ROI\",\"name\":\"ROIcoin\",\"rpcport\":3376,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCOIN\",\"name\":\"xcoin\",\"rpcport\":22717,\"pubtype\":137,\"p2shtype\":15,\"wiftype\":75,\"txfee\":100000}, {\"coin\":\"BBT\",\"name\":\"bitboost\",\"etomic\":\"0x1500205f50bf3fd976466d0662905c9ff254fc9c\",\"rpcport\":80}, {\"coin\":\"TRX\",\"name\":\"tron\",\"etomic\":\"0xf230b790e05390fc8295f4d3f60332c93bed42e2\",\"rpcport\":80}, {\"coin\":\"OMG\",\"name\":\"omisego\",\"etomic\":\"0xd26114cd6EE289AccF82350c8d8487fedB8A0C07\",\"rpcport\":80}, {\"coin\":\"ICX\",\"name\":\"icon\",\"etomic\":\"0xb5a5f22694352c15b00323844ad545abb2b11028\",\"rpcport\":80}, {\"coin\":\"BNB\",\"name\":\"binance-coin\",\"etomic\":\"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\"rpcport\":80}, {\"coin\":\"DGD\",\"name\":\"digixdao\",\"etomic\":\"0xE0B7927c4aF23765Cb51314A0E0521A9645F0E2A\",\"rpcport\":80}, {\"coin\":\"PPT\",\"name\":\"populous\",\"etomic\":\"0xd4fa1460F537bb9085d22C7bcCB5DD450Ef28e3a\",\"rpcport\":80}, {\"coin\":\"MKR\",\"name\":\"maker\",\"etomic\":\"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2\",\"rpcport\":80}, {\"coin\":\"SNT\",\"name\":\"status\",\"etomic\":\"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E\",\"rpcport\":80}, {\"coin\":\"REP\",\"name\":\"augur\",\"etomic\":\"0xE94327D07Fc17907b4DB788E5aDf2ed424adDff6\",\"rpcport\":80}, {\"coin\":\"ZRX\",\"name\":\"0x\",\"etomic\":\"0xE41d2489571d322189246DaFA5ebDe1F4699F498\",\"rpcport\":80}, {\"coin\":\"BAT\",\"name\":\"basic-attention-token\",\"etomic\":\"0x0D8775F648430679A709E98d2b0Cb6250d2887EF\",\"rpcport\":80}, {\"coin\":\"GNT\",\"name\":\"golem\",\"etomic\":\"0xa74476443119A942dE498590Fe1f2454d7D4aC0d\",\"rpcport\":80}, {\"coin\":\"ETHOS\",\"name\":\"ethos\",\"etomic\":\"0x5Af2Be193a6ABCa9c8817001F45744777Db30756\",\"rpcport\":80}, {\"coin\":\"QASH\",\"name\":\"qash\",\"etomic\":\"0x618E75Ac90b12c6049Ba3b27f5d5F8651b0037F6\",\"rpcport\":80}, {\"coin\":\"FUN\",\"name\":\"funfair\",\"etomic\":\"0x419D0d8BdD9aF5e606Ae2232ed285Aff190E711b\",\"rpcport\":80}, {\"coin\":\"KNC\",\"name\":\"kyber-network\",\"etomic\":\"0xdd974D5C2e2928deA5F71b9825b8b646686BD200\",\"rpcport\":80}, {\"coin\":\"SALT\",\"name\":\"salt\",\"etomic\":\"0x4156D3342D5c385a87D264F90653733592000581\",\"rpcport\":80}, {\"coin\":\"BNT\",\"name\":\"bancor\",\"etomic\":\"0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C\",\"rpcport\":80}, {\"coin\":\"ICN\",\"name\":\"iconomi\",\"etomic\":\"0x888666CA69E0f178DED6D75b5726Cee99A87D698\",\"rpcport\":80}, {\"coin\":\"PAY\",\"name\":\"tenx\",\"etomic\":\"0xB97048628DB6B661D4C2aA833e95Dbe1A905B280\",\"rpcport\":80}, {\"coin\":\"REQ\",\"name\":\"request-network\",\"etomic\":\"0x8f8221aFbB33998d8584A2B05749bA73c37a938a\",\"rpcport\":80}, {\"coin\":\"STORJ\",\"name\":\"storj\",\"etomic\":\"0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC\",\"rpcport\":80}, {\"coin\":\"GNO\",\"name\":\"gnosis-gno\",\"etomic\":\"0x6810e776880C02933D47DB1b9fc05908e5386b96\",\"rpcport\":80}, {\"coin\":\"RLC\",\"name\":\"rlc\",\"etomic\":\"0x607F4C5BB672230e8672085532f7e901544a7375\",\"rpcport\":80}, {\"coin\":\"ENJ\",\"name\":\"enjin-coin\",\"etomic\":\"0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c\",\"rpcport\":80}, {\"coin\":\"QSP\",\"name\":\"quantstamp\",\"etomic\":\"0x99ea4dB9EE77ACD40B119BD1dC4E33e1C070b80d\",\"rpcport\":80}, {\"coin\":\"RDN\",\"name\":\"raiden-network-token\",\"etomic\":\"0x255Aa6DF07540Cb5d3d297f0D0D4D84cb52bc8e6\",\"rpcport\":80}, {\"coin\":\"CVC\",\"name\":\"civic\",\"etomic\":\"0x41e5560054824eA6B0732E656E3Ad64E20e94E45\",\"rpcport\":80}, {\"coin\":\"SAN\",\"name\":\"santiment\",\"etomic\":\"0x7C5A0CE9267ED19B22F8cae653F198e3E8daf098\",\"rpcport\":80}, {\"coin\":\"ANT\",\"name\":\"aragon\",\"etomic\":\"0x960b236A07cf122663c4303350609A66A7B288C0\",\"rpcport\":80}, {\"coin\":\"MANA\",\"name\":\"decentraland\",\"etomic\":\"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942\",\"rpcport\":80}, {\"coin\":\"MCO\",\"name\":\"monaco\",\"etomic\":\"0xB63B606Ac810a52cCa15e44bB630fd42D8d1d83d\",\"rpcport\":80}, {\"coin\":\"MTL\",\"name\":\"metal\",\"etomic\":\"0xF433089366899D83a9f26A773D59ec7eCF30355e\",\"rpcport\":80}, {\"coin\":\"EDG\",\"name\":\"edgeless\",\"etomic\":\"0x08711D3B02C8758F2FB3ab4e80228418a7F8e39c\",\"rpcport\":80}, {\"coin\":\"MLN\",\"name\":\"melon\",\"etomic\":\"0xBEB9eF514a379B997e0798FDcC901Ee474B6D9A1\",\"rpcport\":80}, {\"coin\":\"AMB\",\"name\":\"amber\",\"etomic\":\"0x4DC3643DbC642b72C158E7F3d2ff232df61cb6CE\",\"rpcport\":80}, {\"coin\":\"WINGS\",\"name\":\"wings\",\"etomic\":\"0x667088b212ce3d06a1b553a7221E1fD19000d9aF\",\"rpcport\":80}, {\"coin\":\"RCN\",\"name\":\"ripio-credit-network\",\"etomic\":\"0xF970b8E36e23F7fC3FD752EeA86f8Be8D83375A6\",\"rpcport\":80}, {\"coin\":\"SNGLS\",\"name\":\"singulardtv\",\"etomic\":\"0xaeC2E87E0A235266D9C5ADc9DEb4b2E29b54D009\",\"rpcport\":80}, {\"coin\":\"TAAS\",\"name\":\"taas\",\"etomic\":\"0xE7775A6e9Bcf904eb39DA2b68c5efb4F9360e08C\",\"rpcport\":80}, {\"coin\":\"DNT\",\"name\":\"district0x\",\"etomic\":\"0x0AbdAce70D3790235af448C88547603b945604ea\",\"rpcport\":80}, {\"coin\":\"CFI\",\"name\":\"cofound-it\",\"etomic\":\"0x12FEF5e57bF45873Cd9B62E9DBd7BFb99e32D73e\",\"rpcport\":80}, {\"coin\":\"LUN\",\"name\":\"lunyr\",\"etomic\":\"0xfa05A73FfE78ef8f1a739473e462c54bae6567D9\",\"rpcport\":80}, {\"coin\":\"ADT\",\"name\":\"adtoken\",\"etomic\":\"0xD0D6D6C5Fe4a677D343cC433536BB717bAe167dD\",\"rpcport\":80}, {\"coin\":\"AST\",\"name\":\"airswap\",\"etomic\":\"0x27054b13b1B798B345b591a4d22e6562d47eA75a\",\"rpcport\":80}, {\"coin\":\"CDT\",\"name\":\"blox\",\"etomic\":\"0x177d39AC676ED1C67A2b268AD7F1E58826E5B0af\",\"rpcport\":80}, {\"coin\":\"TKN\",\"name\":\"tokencard\",\"etomic\":\"0xaAAf91D9b90dF800Df4F55c205fd6989c977E73a\",\"rpcport\":80}, {\"coin\":\"HMQ\",\"name\":\"humaniq\",\"etomic\":\"0xcbCC0F036ED4788F63FC0fEE32873d6A7487b908\",\"rpcport\":80}, {\"coin\":\"BCAP\",\"name\":\"bcap\",\"etomic\":\"0xFf3519eeeEA3e76F1F699CCcE5E23ee0bdDa41aC\",\"rpcport\":80}, {\"coin\":\"NMR\",\"name\":\"numeraire\",\"etomic\":\"0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671\",\"rpcport\":80}, {\"coin\":\"NET\",\"name\":\"nimiq\",\"etomic\":\"0xcfb98637bcae43C13323EAa1731cED2B716962fD\",\"rpcport\":80}, {\"coin\":\"TRST\",\"name\":\"trust\",\"etomic\":\"0xCb94be6f13A1182E4A4B6140cb7bf2025d28e41B\",\"rpcport\":80}, {\"coin\":\"GUP\",\"name\":\"guppy\",\"etomic\":\"0xf7B098298f7C69Fc14610bf71d5e02c60792894C\",\"rpcport\":80}, {\"coin\":\"1ST\",\"name\":\"firstblood\",\"etomic\":\"0xAf30D2a7E90d7DC361c8C4585e9BB7D2F6f15bc7\",\"rpcport\":80}, {\"coin\":\"TIME\",\"name\":\"chronobank\",\"etomic\":\"0x6531f133e6DeeBe7F2dcE5A0441aA7ef330B4e53\",\"rpcport\":80}, {\"coin\":\"SWT\",\"name\":\"swarm-city\",\"etomic\":\"0xB9e7F8568e08d5659f5D29C4997173d84CdF2607\",\"rpcport\":80}, {\"coin\":\"ROL\",\"name\":\"dice\",\"etomic\":\"0x2e071D2966Aa7D8dECB1005885bA1977D6038A65\",\"rpcport\":80}, {\"coin\":\"XAUR\",\"name\":\"xaurum\",\"etomic\":\"0x4DF812F6064def1e5e029f1ca858777CC98D2D81\",\"rpcport\":80}, {\"coin\":\"PLU\",\"name\":\"pluton\",\"etomic\":\"0xD8912C10681D8B21Fd3742244f44658dBA12264E\",\"rpcport\":80}, {\"coin\":\"HGT\",\"name\":\"hellogold\",\"etomic\":\"0xba2184520A1cC49a6159c57e61E1844E085615B6\",\"rpcport\":80}, {\"coin\":\"VSL\",\"name\":\"vslice\",\"etomic\":\"0x5c543e7AE0A1104f78406C340E9C64FD9fCE5170\",\"rpcport\":80}, {\"coin\":\"IND\",\"name\":\"indorse-token\",\"etomic\":\"0xf8e386EDa857484f5a12e4B5DAa9984E06E73705\",\"rpcport\":80}, {\"coin\":\"FYN\",\"name\":\"fundyourselfnow\",\"etomic\":\"0x88FCFBc22C6d3dBaa25aF478C578978339BDe77a\",\"rpcport\":80},{\"coin\":\"SMART\",\"name\":\"smartcash\",\"rpcport\":9679,\"pubtype\":63,\"p2shtype\":18,\"wiftype\":191,\"txfee\":200000}, {\"coin\":\"BTCP\",\"name\":\"btcprivate\",\"rpcport\":7932,\"taddr\":19,\"pubtype\":37,\"p2shtype\":175,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DNR\",\"isPoS\":1,\"active\":1,\"name\":\"denarius\",\"rpcport\":32339,\"pubtype\":30,\"p2shtype\":90,\"wiftype\":158,\"txfee\":10000}, {\"coin\":\"RVN\",\"name\":\"raven\",\"rpcport\":8766,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"VIVO\",\"name\":\"vivo\",\"confpath\":\"${HOME#}/.vivocore/vivo.conf\",\"rpcport\":9998,\"pubtype\":70,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"KNG\",\"name\":\"kings\",\"rpcport\":44888,\"pubtype\":75,\"p2shtype\":125,\"wiftype\":203,\"txfee\":10000}, {\"coin\":\"UFO\",\"name\":\"ufocoin\",\"confpath\":\"${HOME#}/.ufo/ufocoin.conf\",\"rpcport\":9888,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":155,\"txfee\":100000}, {\"coin\":\"ETH\",\"name\":\"ethereum\",\"etomic\":\"0x0000000000000000000000000000000000000000\",\"rpcport\":80}, {\"coin\":\"EOS\",\"name\":\"EOS\",\"etomic\":\"0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0\",\"rpcport\":80}, {\"coin\":\"KREDS\",\"name\":\"kreds\",\"rpcport\":3850,\"pubtype\":45,\"p2shtype\":5,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"SNG\",\"name\":\"snowgem\",\"rpcport\":16112,\"taddr\":28,\"pubtype\":40,\"p2shtype\":45,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"ZEL\",\"name\":\"zelcash\",\"rpcport\":16124,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"HTML\",\"name\":\"htmlcoin\",\"rpcport\":4889,\"pubtype\":41,\"p2shtype\":100,\"wiftype\":169,\"txfee\":400000}, {\"coin\":\"MNX\",\"name\":\"Minexcoin\",\"rpcport\":17786,\"pubtype\":75,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LTZ\",\"name\":\"litecoinz\",\"rpcport\":29332,\"taddr\":10,\"pubtype\":179,\"p2shtype\":184,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BAY\",\"name\":\"bitbay\",\"isPoS\":1,\"rpcport\":19915,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"OOT\",\"asset\":\"OOT\",\"rpcport\":12467}, {\"coin\":\"ZOI\",\"name\":\"zoin\",\"rpcport\":8255,\"pubtype\":80,\"p2shtype\":7,\"wiftype\":208,\"txfee\":1000}, {\"coin\": \"PIZZA\",\"asset\": \"PIZZA\",\"rpcport\": 11116},{\"coin\": \"BEER\",\"asset\": \"BEER\",\"rpcport\": 8923}, {\"coin\":\"GRS\",\"name\":\"groestlcoin\",\"rpcport\":1441,\"pubtype\":36,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XMCC\",\"name\":\"monoeci\",\"confpath\":\"${HOME#}/.monoeciCore/monoeci.conf\",\"rpcport\":24156,\"pubtype\":50,\"p2shtype\":73,\"wiftype\":77,\"txfee\":10000}, {\"coin\":\"BTCH\",\"asset\":\"BTCH\",\"rpcport\":8800},{\"coin\":\"ETOMIC\",\"asset\":\"ETOMIC\",\"rpcport\":10271},{\"coin\":\"AXO\",\"asset\":\"AXO\",\"rpcport\":12927},{\"coin\":\"CRC\",\"name\":\"crowdcoin\",\"confpath\":\"${HOME#}/.crowdcoincore/crowdcoin.conf\",\"rpcport\":11998,\"pubtype\":28,\"p2shtype\":88,\"wiftype\":0,\"txfee\":10000}, {\"coin\":\"VOT\",\"name\":\"votecoin\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"INN\",\"name\":\"innova\",\"confpath\":\"${HOME#}/.innovacore/innova.conf\",\"rpcport\":8818,\"pubtype\":102,\"p2shtype\":20,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":28,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"EFL\",\"name\":\"egulden\",\"confpath\":\"${HOME#}/.egulden/coin.conf\",\"rpcport\":21015,\"pubtype\":48,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"GBX\",\"name\":\"gobyte\",\"confpath\":\"${HOME#}/.gobytecore/gobyte.conf\",\"rpcport\":12454,\"pubtype\":38,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"BCO\",\"name\":\"bridgecoin\",\"rpcport\":6332,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"confpath\":\"${HOME#}/.lore/blackcoin.conf\",\"isPoS\":1,\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":100000}, {\"coin\":\"BTG\",\"name\":\"bitcoingold\",\"rpcport\":8332,\"pubtype\":38,\"p2shtype\":23,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BCH\",\"name\":\"bch\",\"rpcport\":33333,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"ABY\",\"name\":\"applebyte\",\"rpcport\":8607,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":100000}, {\"coin\":\"STAK\",\"name\":\"straks\",\"rpcport\":7574,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"XZC\",\"name\":\"zcoin\",\"rpcport\":8888,\"pubtype\":82,\"p2shtype\":7,\"wiftype\":210,\"txfee\":10000}, {\"coin\":\"QTUM\",\"name\":\"qtum\",\"rpcport\":3889,\"pubtype\":58,\"p2shtype\":50,\"wiftype\":128,\"txfee\":400000}, {\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":100000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":10000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"MSHARK\",\"asset\":\"MSHARK\",\"rpcport\":8846}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From d940bc3144a7aabe20206b5d83e69ae023726f59 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 16:50:29 +0300 Subject: [PATCH 26/98] cancel_order to purge all remnants of uuid --- iguana/exchanges/LP_include.h | 3 ++- iguana/exchanges/LP_ordermatch.c | 39 +++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index c5f752471..632c344bd 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -459,7 +459,7 @@ struct LP_trade uint64_t aliceid; int64_t besttrust,bestunconfcredits; double bestprice; - uint32_t negotiationdone,bestresponse,connectsent,firsttime,lasttime,firstprocessed,lastprocessed,newtime; + uint32_t negotiationdone,bestresponse,connectsent,firsttime,lasttime,firstprocessed,lastprocessed,newtime,cancelled; char pairstr[64],funcid,iambob; struct LP_quoteinfo Qs[4],Q; }; @@ -575,6 +575,7 @@ int64_t LP_dynamictrust(int64_t credits,bits256 pubkey,int64_t kmdvalue); struct LP_address *LP_addressfind(struct iguana_info *coin,char *coinaddr); int64_t LP_outpoint_amount(char *symbol,bits256 txid,int32_t vout); void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint16_t myport,uint16_t netid,char *seednode); +int32_t LP_trades_canceluuid(char *uuidstr); int _decreasing_uint64(const void *a,const void *b); int32_t LP_alice_eligible(uint32_t quotetime); int32_t LP_is_slowcoin(char *symbol); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ed2425f2c..90651e3e2 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -625,6 +625,7 @@ int32_t LP_alice_eligible(uint32_t quotetime) char *LP_cancel_order(char *uuidstr) { + LP_trades_canceluuid(uuidstr); if ( uuidstr != 0 && strcmp(LP_Alicequery.uuidstr,uuidstr) == 0 ) { LP_failedmsg(LP_Alicequery.R.requestid,LP_Alicequery.R.quoteid,-9998,LP_Alicequery.uuidstr); @@ -1148,6 +1149,30 @@ int32_t LP_trades_bestpricecheck(void *ctx,struct LP_trade *tp) return(0); } +int32_t LP_trades_canceluuid(char *uuidstr) +{ + int32_t num = 0; struct LP_trade *qtp,*tp,*tmp; + HASH_ITER(hh,LP_trades,tp,tmp) + { + if ( strcmp(tp->Q.uuidstr,uuidstr) == 0 ) + { + tp->cancelled = (uint32_t)time(NULL); + num++; + } + } + DL_FOREACH_SAFE(LP_tradesQ,qtp,tmp) + { + if ( strcmp(qtp->Q.uuidstr,uuidstr) == 0 ) + { + qtp->cancelled = (uint32_t)time(NULL); + num++; + } + } + if ( num > 0 ) + fprintf(stderr,"uuid.%s %d cancelled\n",num); + return(num); +} + void LP_tradesloop(void *ctx) { struct LP_trade *qtp,*tp,*tmp; struct LP_quoteinfo *qp,Q; uint32_t now; int32_t timeout,funcid,flag,nonz; struct iguana_info *coin; struct LP_pubkey_info *pubp; @@ -1160,7 +1185,7 @@ void LP_tradesloop(void *ctx) nonz = 0; HASH_ITER(hh,LP_trades,tp,tmp) { - if ( tp->negotiationdone != 0 ) + if ( tp->negotiationdone != 0 || tp->cancelled != 0 ) continue; //printf("check %s\n",tp->Q.uuidstr+32); timeout = LP_AUTOTRADE_TIMEOUT; @@ -1202,7 +1227,7 @@ void LP_tradesloop(void *ctx) timeout += LP_AUTOTRADE_TIMEOUT * .5; if ( (coin= LP_coinfind(tp->Q.destcoin)) != 0 && coin->electrum != 0 ) timeout += LP_AUTOTRADE_TIMEOUT * .5; - if ( now > tp->firstprocessed+timeout*10 ) + if ( now > tp->firstprocessed+timeout*10 || tp->cancelled != 0 ) { //printf("purge swap aliceid.%llu\n",(long long)tp->aliceid); portable_mutex_lock(&LP_tradesmutex); @@ -1220,9 +1245,17 @@ void LP_tradesloop(void *ctx) portable_mutex_lock(&LP_tradesmutex); DL_DELETE(LP_tradesQ,qtp); HASH_FIND(hh,LP_trades,&qtp->aliceid,sizeof(qtp->aliceid),tp); + if ( tp->cancelled != 0 ) + + { + fprintf(stderr,"purging cancelled %s funcid.%d\n",tp->uuidstr,tp->funcid); + HASH_DELETE(hh,LP_trades,tp); + free(tp); + continue; + } if ( tp == 0 ) { - if ( now > Q.timestamp+LP_AUTOTRADE_TIMEOUT*2 ) // eat expired + if ( now > Q.timestamp+LP_AUTOTRADE_TIMEOUT*2 || qtp->cancelled != 0 ) // eat expired free(qtp); else { From 5b2492bd47582764d0c33e493c69882863a014db Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 16:51:46 +0300 Subject: [PATCH 27/98] Fix --- iguana/exchanges/LP_ordermatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 90651e3e2..377878221 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1169,7 +1169,7 @@ int32_t LP_trades_canceluuid(char *uuidstr) } } if ( num > 0 ) - fprintf(stderr,"uuid.%s %d cancelled\n",num); + fprintf(stderr,"uuid.%s %d cancelled\n",uuidstr,num); return(num); } @@ -1248,7 +1248,7 @@ void LP_tradesloop(void *ctx) if ( tp->cancelled != 0 ) { - fprintf(stderr,"purging cancelled %s funcid.%d\n",tp->uuidstr,tp->funcid); + fprintf(stderr,"purging cancelled %s funcid.%d\n",tp->Q.uuidstr,tp->funcid); HASH_DELETE(hh,LP_trades,tp); free(tp); continue; From a979032d7626518949d25d3b0d7997ce26472950 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 16:53:19 +0300 Subject: [PATCH 28/98] Cancel demo script --- iguana/exchanges/cancel | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 iguana/exchanges/cancel diff --git a/iguana/exchanges/cancel b/iguana/exchanges/cancel new file mode 100755 index 000000000..2f7bc1111 --- /dev/null +++ b/iguana/exchanges/cancel @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"cancel\",\"uuid\":\"\"}" From cafa8eaeb43107a9eaadb4d8a94a801cc105af11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:01:16 +0300 Subject: [PATCH 29/98] Test --- iguana/exchanges/LP_utxo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 9734ebb7d..adc2cf9ec 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -548,6 +548,7 @@ struct LP_address *LP_address_utxo_reset(int32_t *nump,struct iguana_info *coin) portable_mutex_lock(&coin->addressutxo_mutex); if ( (array= LP_listunspent(coin->symbol,coin->smartaddr,zero,zero)) != 0 ) { + printf("array.%s\n",jprint(array,0)); portable_mutex_lock(&coin->addrmutex); portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) From e6afc821b5580928dc1a6a2bf5d1d7cb1a3f6d38 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:06:32 +0300 Subject: [PATCH 30/98] Test --- iguana/exchanges/LP_rpc.c | 6 ++++-- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 9168ce9d6..505192bf5 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -417,6 +417,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi usecache = 0; else if ( time(NULL) > ap->unspenttime+3 ) usecache = 0; + usecache = 0; // disable unspents cache for native //printf("%s %s usecache.%d iswatched.%d\n",coin->symbol,coinaddr,usecache,LP_address_iswatchonly(symbol,coinaddr)); if ( usecache != 0 && (retstr= LP_unspents_filestr(symbol,coinaddr)) != 0 ) { @@ -435,9 +436,10 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi else numconfs = 1; sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); retjson = bitcoin_json(coin,"listunspent",buf); -//printf("LP_listunspent.(%s %s) -> %s\n",symbol,coinaddr,jprint(retjson,0)); +printf("LP_listunspent.(%s %s) -> %s\n",symbol,coinaddr,jprint(retjson,0)); if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { + chat str[65]; array = cJSON_CreateArray(); for (i=0; iaddressutxo_mutex); if ( (array= LP_listunspent(coin->symbol,coin->smartaddr,zero,zero)) != 0 ) { - printf("array.%s\n",jprint(array,0)); + printf("%s array.%s\n",coin->symbol,jprint(array,0)); portable_mutex_lock(&coin->addrmutex); portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) From 3a2a95d1a91e4b1fc896c86b0b8ffa7ce1a1d661 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:07:14 +0300 Subject: [PATCH 31/98] Test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 505192bf5..77b672484 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -450,7 +450,7 @@ printf("LP_listunspent.(%s %s) -> %s\n",symbol,coinaddr,jprint(retjson,0)); { jaddi(array,jduplicate(item)); free_json(txjson); - } else fprintf("%s/v%d is spent\n",bits256_str(str,txid),vout); + } else printf("%s/v%d is spent\n",bits256_str(str,txid),vout); } free_json(retjson); retjson = array; From 740b9ccf8dda5f479e1b63514a81fc44efe3fe66 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:07:54 +0300 Subject: [PATCH 32/98] test --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 77b672484..5c2bd28a0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -439,7 +439,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi printf("LP_listunspent.(%s %s) -> %s\n",symbol,coinaddr,jprint(retjson,0)); if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { - chat str[65]; + char str[65]; array = cJSON_CreateArray(); for (i=0; i Date: Wed, 25 Apr 2018 17:11:06 +0300 Subject: [PATCH 33/98] Test --- iguana/exchanges/LP_rpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5c2bd28a0..31b376c51 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -57,11 +57,11 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) if ( coin->electrum == 0 ) { retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); - if ( 0 && strcmp("KMD",coin->symbol) == 0 ) - printf("%s.(%s %s): %s.%s -> (%s)\n",coin->symbol,coin->serverport,coin->userpass,method,params,retstr); if ( retstr != 0 && retstr[0] != 0 ) { - retjson = cJSON_Parse(retstr); + if ( strcmp(method,"listunspent") == 0 ) + printf("%s.(%s %s): %s.%s -> (%s)\n",coin->symbol,coin->serverport,coin->userpass,method,params,retstr); + retjson = cJSON_Parse(retstr); free(retstr); } } @@ -436,7 +436,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi else numconfs = 1; sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); retjson = bitcoin_json(coin,"listunspent",buf); -printf("LP_listunspent.(%s %s) -> %s\n",symbol,coinaddr,jprint(retjson,0)); +printf("LP_listunspent.(%s %s) -> %s\n",symbol,buf,jprint(retjson,0)); if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { char str[65]; From 9e12d9f8e57c647deb4b67f32a8b91b526792114 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:14:35 +0300 Subject: [PATCH 34/98] Test --- iguana/exchanges/LP_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 31b376c51..fbbb605b0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -49,7 +49,8 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // bitcoind_passthru callers: "importaddress", "estimatefee", "getblockhash", "sendrawtransaction", "signrawtransaction" if ( coin != 0 ) { - //printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); + if ( strcmp(method,"listunspent") == 0 ) + printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) From bac6fff574fbf9b33eb96e0c46466bfb647e9788 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:19:42 +0300 Subject: [PATCH 35/98] Test --- iguana/exchanges/LP_rpc.c | 14 +++++++------- iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index fbbb605b0..93a2b75e1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -49,8 +49,8 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // bitcoind_passthru callers: "importaddress", "estimatefee", "getblockhash", "sendrawtransaction", "signrawtransaction" if ( coin != 0 ) { - if ( strcmp(method,"listunspent") == 0 ) - printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); + //if ( strcmp(method,"listunspent") == 0 ) + // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) @@ -60,9 +60,9 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params); if ( retstr != 0 && retstr[0] != 0 ) { - if ( strcmp(method,"listunspent") == 0 ) - printf("%s.(%s %s): %s.%s -> (%s)\n",coin->symbol,coin->serverport,coin->userpass,method,params,retstr); - retjson = cJSON_Parse(retstr); + //if ( strcmp(method,"listunspent") == 0 ) + // printf("%s.(%s %s): %s.%s -> (%s)\n",coin->symbol,coin->serverport,coin->userpass,method,params,retstr); + retjson = cJSON_Parse(retstr); free(retstr); } } @@ -437,7 +437,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi else numconfs = 1; sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); retjson = bitcoin_json(coin,"listunspent",buf); -printf("LP_listunspent.(%s %s) -> %s\n",symbol,buf,jprint(retjson,0)); +//printf("LP_listunspent.(%s %s) -> %s\n",symbol,buf,jprint(retjson,0)); if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { char str[65]; @@ -451,7 +451,7 @@ printf("LP_listunspent.(%s %s) -> %s\n",symbol,buf,jprint(retjson,0)); { jaddi(array,jduplicate(item)); free_json(txjson); - } else printf("%s/v%d is spent\n",bits256_str(str,txid),vout); + } //else printf("%s/v%d is spent\n",bits256_str(str,txid),vout); } free_json(retjson); retjson = array; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 7efe800b9..4e4a4fa3e 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -548,7 +548,7 @@ struct LP_address *LP_address_utxo_reset(int32_t *nump,struct iguana_info *coin) portable_mutex_lock(&coin->addressutxo_mutex); if ( (array= LP_listunspent(coin->symbol,coin->smartaddr,zero,zero)) != 0 ) { - printf("%s array.%s\n",coin->symbol,jprint(array,0)); + //printf("%s array.%s\n",coin->symbol,jprint(array,0)); portable_mutex_lock(&coin->addrmutex); portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) From 5aef2ea6a9e8769c293420cc64c1256e66002e82 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:24:34 +0300 Subject: [PATCH 36/98] Test --- iguana/exchanges/LP_ordermatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 377878221..b50ff408b 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1245,7 +1245,7 @@ void LP_tradesloop(void *ctx) portable_mutex_lock(&LP_tradesmutex); DL_DELETE(LP_tradesQ,qtp); HASH_FIND(hh,LP_trades,&qtp->aliceid,sizeof(qtp->aliceid),tp); - if ( tp->cancelled != 0 ) + if ( tp != 0 && tp->cancelled != 0 ) { fprintf(stderr,"purging cancelled %s funcid.%d\n",tp->Q.uuidstr,tp->funcid); From fd075ac7efea3a7806acf5648b3578351b1a8c1a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:29:10 +0300 Subject: [PATCH 37/98] Test --- iguana/exchanges/LP_ordermatch.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index b50ff408b..0a5746f4e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -625,12 +625,15 @@ int32_t LP_alice_eligible(uint32_t quotetime) char *LP_cancel_order(char *uuidstr) { - LP_trades_canceluuid(uuidstr); - if ( uuidstr != 0 && strcmp(LP_Alicequery.uuidstr,uuidstr) == 0 ) + if ( uuidstr != 0 ) { - LP_failedmsg(LP_Alicequery.R.requestid,LP_Alicequery.R.quoteid,-9998,LP_Alicequery.uuidstr); - LP_alicequery_clear(); - return(clonestr("{\"result\":\"success\",\"status\":\"uuid canceled\"}")); + LP_trades_canceluuid(uuidstr); + if ( strcmp(LP_Alicequery.uuidstr,uuidstr) == 0 ) + { + LP_failedmsg(LP_Alicequery.R.requestid,LP_Alicequery.R.quoteid,-9998,LP_Alicequery.uuidstr); + LP_alicequery_clear(); + return(clonestr("{\"result\":\"success\",\"status\":\"uuid canceled\"}")); + } else return(clonestr("{\"result\":\"success\",\"status\":\"will stop trade negotiation, but if swap started it wont cancel\"}")); } return(clonestr("{\"error\":\"uuid not cancellable\"}")); } From 34f857578e45921caff45adfa60ff264d1629f8a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Apr 2018 17:35:20 +0300 Subject: [PATCH 38/98] Update cancel API to more fully purge it from the system --- iguana/exchanges/LP_ordermatch.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 0a5746f4e..4d6f1a39a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -625,15 +625,20 @@ int32_t LP_alice_eligible(uint32_t quotetime) char *LP_cancel_order(char *uuidstr) { + int32_t num = 0; cJSON *retjson; if ( uuidstr != 0 ) { - LP_trades_canceluuid(uuidstr); + num = LP_trades_canceluuid(uuidstr); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddnum(retjson,"numentries",num); if ( strcmp(LP_Alicequery.uuidstr,uuidstr) == 0 ) { LP_failedmsg(LP_Alicequery.R.requestid,LP_Alicequery.R.quoteid,-9998,LP_Alicequery.uuidstr); LP_alicequery_clear(); - return(clonestr("{\"result\":\"success\",\"status\":\"uuid canceled\"}")); - } else return(clonestr("{\"result\":\"success\",\"status\":\"will stop trade negotiation, but if swap started it wont cancel\"}")); + jaddstr(retjson,"status","uuid canceled"); + } else jaddstr(retjson,"status","will stop trade negotiation, but if swap started it wont cancel"); + return(jprint(retjson,1)); } return(clonestr("{\"error\":\"uuid not cancellable\"}")); } From ff5cfcbf7048b51437e7c94920d43c5a922f7fce Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 11:25:40 +0300 Subject: [PATCH 39/98] Reduce max momdepth to 1440 --- iguana/dpow/dPoW.h | 228 ++++++++++++++++++++++++++++++++++++++++++ iguana/dpow/dpow_tx.c | 2 +- 2 files changed, 229 insertions(+), 1 deletion(-) create mode 100755 iguana/dpow/dPoW.h diff --git a/iguana/dpow/dPoW.h b/iguana/dpow/dPoW.h new file mode 100755 index 000000000..163c640a3 --- /dev/null +++ b/iguana/dpow/dPoW.h @@ -0,0 +1,228 @@ +/****************************************************************************** + * Copyright © 2014-2018 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + +#ifndef INCLUDE_DPOW_H +#define INCLUDE_DPOW_H + +#define DPOW_MAXMOMDEPTH (1440) + +#define DPOW_FIRSTRATIFY 1000 + +#define DPOW_CHECKPOINTFREQ 10 +#define DPOW_MINSIGS 13 +#define DPOW_MIN_ASSETCHAIN_SIGS 11 +//#define DPOW_M(bp) ((bp)->minsigs) // (((bp)->numnotaries >> 1) + 1) +#define DPOW_MODIND(bp,offset) (((((bp)->height / DPOW_CHECKPOINTFREQ) % (bp)->numnotaries) + (offset)) % (bp)->numnotaries) +#define DPOW_VERSION 0x1782 +#define DPOW_UTXOSIZE 10000//50000 +#define DPOW_MINOUTPUT 6000 +#define DPOW_DURATION 600 +#define DPOW_RATIFYDURATION (3600 * 24) + +//#define DPOW_ENTRIESCHANNEL ('e' | ('n' << 8) | ('t' << 16) | ('r' << 24)) +//#define DPOW_BTCENTRIESCHANNEL (~DPOW_ENTRIESCHANNEL) +//#define DPOW_UTXOCHANNEL ('d' | ('P' << 8) | ('o' << 16) | ('W' << 24)) +#define DPOW_SIGCHANNEL ('s' | ('i' << 8) | ('g' << 16) | ('s' << 24)) +#define DPOW_SIGBTCCHANNEL (~DPOW_SIGCHANNEL) +#define DPOW_TXIDCHANNEL ('t' | ('x' << 8) | ('i' << 16) | ('d' << 24)) +#define DPOW_BTCTXIDCHANNEL (~DPOW_TXIDCHANNEL) + + +#define DPOW_FIFOSIZE 64 +#define DPOW_MAXTX 8192 +#define DPOW_THIRDPARTY_CONFIRMS 0 +#define DPOW_KOMODOCONFIRMS 10 +#define DPOW_BTCCONFIRMS 1 +#define DPOW_MAXRELAYS 64 +#define DPOW_MAXSIGLEN 128 + +#define DEX_VERSION 0x0105 +#define DPOW_SOCKPORT 7775 +#define DEX_SOCK 7774 +#define PUB_SOCK 7773 +#define REP_SOCK 7772 + +#define DPOW_EPOCHDURATION 600 + +struct dpow_coinentry +{ + bits256 prev_hash; + uint8_t siglens[DPOW_MAXRELAYS],sigs[DPOW_MAXRELAYS][DPOW_MAXSIGLEN]; + int32_t prev_vout; +}; + +struct dpow_utxoentry +{ + bits256 srchash,desthash,commit,hashmsg; + uint64_t recvmask,othermasks[DPOW_MAXRELAYS]; + int32_t srcvout,destvout,height; + int8_t bestk; uint8_t pubkey[33]; +}; + +struct dpow_entry +{ + bits256 commit,beacon,ratifysrcutxo,ratifydestutxo; + uint64_t masks[2][DPOW_MAXRELAYS],recvmask,othermask,bestmask,ratifyrecvmask,ratifybestmask; + int32_t height; uint32_t pendingcrcs[2],paxwdcrc; + uint16_t ratifysrcvout,ratifydestvout; + int8_t bestk,ratifybestk; + uint8_t pubkey[33],ratifysigs[2][DPOW_MAXSIGLEN],ratifysiglens[2]; + struct dpow_coinentry src,dest; +}; + +struct dpow_sigentry +{ + bits256 beacon; + uint64_t mask; + int32_t refcount; + uint8_t senderind,lastk,siglen,sig[DPOW_MAXSIGLEN],senderpub[33]; +}; + +struct komodo_notaries +{ + struct basilisk_relay RELAYS[DPOW_MAXRELAYS]; + int32_t NUMRELAYS,RELAYID; +}; + +struct dpow_hashheight { bits256 hash; int32_t height; }; + +struct dpow_checkpoint +{ + struct dpow_hashheight blockhash,approved; + bits256 miner; uint32_t blocktime,timestamp; +}; + +struct dpow_block +{ + bits256 hashmsg,desttxid,srctxid,beacon,commit,MoM; + struct iguana_info *srccoin,*destcoin; char *opret_symbol; + uint64_t destsigsmasks[DPOW_MAXRELAYS],srcsigsmasks[DPOW_MAXRELAYS]; + uint64_t recvmask,bestmask,ratifybestmask,ratifyrecvmask,pendingbestmask,pendingratifybestmask,ratifysigmasks[2]; + struct dpow_entry notaries[DPOW_MAXRELAYS]; + uint32_t MoMdepth,state,starttime,timestamp,waiting,sigcrcs[2],txidcrcs[2],utxocrcs[2],lastepoch,paxwdcrc; + int32_t rawratifiedlens[2],height,numnotaries,numerrors,completed,minsigs,duration,numratified,isratify,require0,scores[DPOW_MAXRELAYS]; + int8_t myind,bestk,ratifybestk,pendingbestk,pendingratifybestk; + cJSON *ratified; + uint8_t ratified_pubkeys[DPOW_MAXRELAYS][33],ratifysigs[2][DPOW_MAXSIGLEN],ratifysiglens[2]; + char handles[DPOW_MAXRELAYS][32]; + char signedtx[32768]; uint8_t ratifyrawtx[2][32768]; uint32_t pendingcrcs[2]; +}; + +struct pax_transaction +{ + UT_hash_handle hh; + bits256 txid; + uint64_t komodoshis,fiatoshis; + int32_t marked,height,kmdheight; + uint16_t vout; + char symbol[16],coinaddr[64]; uint8_t rmd160[20],shortflag; +}; + +struct dpow_info +{ + char symbol[16],dest[16]; uint8_t minerkey33[33],minerid; uint64_t lastrecvmask; + struct dpow_checkpoint checkpoint,last,destchaintip,srcfifo[DPOW_FIFOSIZE],destfifo[DPOW_FIFOSIZE]; + struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE]; + bits256 activehash,lastnotarized,srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; + uint32_t SRCREALTIME,lastsrcupdate,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify; + int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying; + struct pax_transaction *PAX; + portable_mutex_t paxmutex,dexmutex; + uint32_t ipbits[128],numipbits; + struct dpow_block **blocks; +}; + +struct komodo_ccdatapair { int32_t notarization_height; uint32_t MoMoMoffset; }; + +struct komodo_ccdataMoMoM +{ + bits256 MoMoM; + int32_t kmdstarti,kmdendi,MoMoMdepth,numpairs,len; + struct komodo_ccdatapair *pairs; +}; + +uint64_t dpow_notarybestk(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp); +int32_t dpow_paxpending(uint8_t *hex,int32_t hexsize,uint32_t *paxwdcrcp,bits256 MoM,uint32_t MoMdepth,int32_t src_or_dest,struct dpow_block *bp); +void dex_updateclient(struct supernet_info *myinfo); +char *dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *data,int32_t datalen,int32_t M,char *field); +char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int32_t keylen,uint8_t *data,int32_t datalen,int32_t sendping,uint32_t duration); +int32_t dpow_getchaintip(struct supernet_info *myinfo,bits256 *merklerootp,bits256 *blockhashp,uint32_t *blocktimep,bits256 *txs,uint32_t *numtxp,struct iguana_info *coin); +void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen); +int32_t dpow_nanomsg_update(struct supernet_info *myinfo); +int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits256 *txidp,int32_t *voutp,char *coinaddr,char *srccoin); +void komodo_assetcoins(int32_t fullnode,uint64_t mask); +int32_t iguana_isnotarychain(char *symbol); + +cJSON *dpow_getinfo(struct supernet_info *myinfo,struct iguana_info *coin); +cJSON *dpow_gettransaction(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid); +cJSON *dpow_getblock(struct supernet_info *myinfo,struct iguana_info *coin,bits256 blockhash); +bits256 dpow_getblockhash(struct supernet_info *myinfo,struct iguana_info *coin,int32_t height); +bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *coin); +char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *signedtx); +cJSON *dpow_gettxout(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t vout); +char *dpow_importaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address); +char *dpow_validateaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address); +cJSON *dpow_listunspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); +cJSON *dpow_listtransactions(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr,int32_t count,int32_t skip); +char *dpow_alladdresses(struct supernet_info *myinfo,struct iguana_info *coin); +cJSON *dpow_kvupdate(struct supernet_info *myinfo,struct iguana_info *coin,char *key,char *value,int32_t flags); +cJSON *dpow_kvsearch(struct supernet_info *myinfo,struct iguana_info *coin,char *key); +void init_alladdresses(struct supernet_info *myinfo,struct iguana_info *coin); +cJSON *dpow_getmessage(struct supernet_info *myinfo,char *jsonstr); +cJSON *dpow_addmessage(struct supernet_info *myinfo,char *jsonstr); +cJSON *dpow_psock(struct supernet_info *myinfo,char *jsonstr); + +char *_dex_getinfo(struct supernet_info *myinfo,char *symbol); +char *_dex_getrawtransaction(struct supernet_info *myinfo,char *symbol,bits256 txid); +char *_dex_getblock(struct supernet_info *myinfo,char *symbol,bits256 hash2); +char *_dex_getblockhash(struct supernet_info *myinfo,char *symbol,int32_t height); +char *_dex_getbestblockhash(struct supernet_info *myinfo,char *symbol); +char *_dex_sendrawtransaction(struct supernet_info *myinfo,char *symbol,char *signedtx); +char *_dex_gettxout(struct supernet_info *myinfo,char *symbol,bits256 txid,int32_t vout); +char *_dex_gettxin(struct supernet_info *myinfo,char *symbol,bits256 txid,int32_t vout); +char *_dex_importaddress(struct supernet_info *myinfo,char *symbol,char *address); +char *_dex_validateaddress(struct supernet_info *myinfo,char *symbol,char *address); +char *_dex_getmessage(struct supernet_info *myinfo,char *jsonstr); +char *_dex_listunspent(struct supernet_info *myinfo,char *symbol,char *address); +char *_dex_listunspent2(struct supernet_info *myinfo,char *symbol,char *address); +char *_dex_listspent(struct supernet_info *myinfo,char *symbol,char *address); +char *_dex_getbalance(struct supernet_info *myinfo,char *symbol,char *address); +char *_dex_listtransactions(struct supernet_info *myinfo,char *symbol,char *coinaddr,int32_t count,int32_t skip); +char *_dex_listtransactions2(struct supernet_info *myinfo,char *symbol,char *coinaddr,int32_t count,int32_t skip); +char *_dex_alladdresses(struct supernet_info *myinfo,char *symbol); +int32_t _dex_getheight(struct supernet_info *myinfo,char *symbol); +char *_dex_getnotaries(struct supernet_info *myinfo,char *symbol); +char *_dex_kvupdate(struct supernet_info *myinfo,char *symbol,char *key,char *value,int32_t flags); +char *_dex_kvsearch(struct supernet_info *myinfo,char *symbol,char *key); +char *_dex_psock(struct supernet_info *myinfo,char *jsonstr); + +int32_t komodo_notaries(char *symbol,uint8_t pubkeys[64][33],int32_t height); +cJSON *dpow_checkaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address); + +void dex_channelsend(struct supernet_info *myinfo,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgid,uint8_t *data,int32_t datalen); +void kmd_bitcoinscan(); +cJSON *kmd_getbalance(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); +struct iguana_info *iguana_coinfind(char *symbol); +cJSON *kmd_listtransactions(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr,int32_t count,int32_t skip); +cJSON *kmd_listunspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); +cJSON *kmd_listspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); +cJSON *kmd_gettxin(struct iguana_info *coin,bits256 txid,int32_t vout); + +cJSON *dpow_listspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); +cJSON *dpow_getbalance(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); +cJSON *dpow_gettxin(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t vout); + + +#endif diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index eef750a80..f59e1268d 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -226,7 +226,7 @@ int32_t dpow_voutstandard(struct dpow_block *bp,uint8_t *serialized,int32_t m,in } printf("numvouts.%d len.%d RATIFY vouts\n",numvouts,len); } - if ( bp->MoMdepth > 0 && (strcmp(bp->destcoin->symbol,"KMD") == 0 || strcmp(bp->srccoin->symbol,"KMD") == 0) ) + if ( bp->MoMdepth > 0 && strcmp(bp->destcoin->symbol,"KMD") == 0 ) // || strcmp(bp->srccoin->symbol,"KMD") == 0) ) { n = dpow_paxpending(extras,sizeof(extras),&paxwdcrc,bp->MoM,bp->MoMdepth,src_or_dest,bp); } From bdf483520b1cdc7a8a9c7e2dc8c9c0bb78dcd2b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 11:57:24 +0300 Subject: [PATCH 40/98] -MoM for KMD --- iguana/dpow/dpow_fsm.c | 9 ++++++--- iguana/m_notary_run | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index a9f479a55..a7fca399c 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -439,9 +439,12 @@ void dpow_statemachinestart(void *ptr) return; } MoMdepth = 0; - portable_mutex_lock(&src->MoM_mutex); - MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); - portable_mutex_unlock(&src->MoM_mutex); + if ( strcmp(dp->dest,"KMD") == 0 ) + { + portable_mutex_lock(&src->MoM_mutex); + MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); + portable_mutex_unlock(&src->MoM_mutex); + } else memset(&MoM,0,sizeof(MoM)); if ( strcmp(src->symbol,"KMD") == 0 ) kmdheight = checkpoint.blockhash.height; else if ( strcmp(dest->symbol,"KMD") == 0 ) diff --git a/iguana/m_notary_run b/iguana/m_notary_run index 3eaa49dff..fc9ad6ac2 100755 --- a/iguana/m_notary_run +++ b/iguana/m_notary_run @@ -53,4 +53,5 @@ coins/prlpay_7776 #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"passthru\",\"method\":\"paxfiats\",\"timeout\":900000}" #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}" +sleep 30 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}" From 48e5b60bdc11c0b13d6079fd3598ef6f51c39f6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 11:59:26 +0300 Subject: [PATCH 41/98] -ltc_7776 --- iguana/m_notary_run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/m_notary_run b/iguana/m_notary_run index fc9ad6ac2..a36cbfa04 100755 --- a/iguana/m_notary_run +++ b/iguana/m_notary_run @@ -18,7 +18,7 @@ curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\" sleep 3 tests/addnotarys_7776 coins/btc_7776 -coins/ltc_7776 +#coins/ltc_7776 coins/kmd_7776 coins/chips_7776 ./wp_7776 From 3d652d791e79f51b3467093d93cc2409e45c9a43 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 12:24:13 +0300 Subject: [PATCH 42/98] -print --- iguana/iguana_notary.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 66d727f5b..ecaa0b084 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -76,7 +76,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he else freq = 1; } dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); - if ( strcmp(dp->dest,"KMD") == 0 || strcmp(dp->dest,"CHAIN") == 0 ) + if ( strcmp(dp->dest,"KMD") == 0 )//|| strcmp(dp->dest,"CHAIN") == 0 ) { //if ( dp->SRCREALTIME == 0 ) // return; @@ -97,7 +97,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he if ( height > 0 && blocktime > 0 ) { dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); - if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) printf("dynamic set %s/%s %s <- height.%d\n",dp->symbol,dp->dest,bits256_str(str,hash),height); checkpoint = dp->last; } else return; @@ -111,7 +111,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); return; } - if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); } else return; } else return; @@ -120,7 +120,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he } if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) { - if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); dpow_heightfind(myinfo,dp,checkpoint.blockhash.height + 1000); ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint) + sizeof(pthread_t)); From 4028859ea8ed166ad43cdb61409b95a88b10063b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 12:25:53 +0300 Subject: [PATCH 43/98] +print --- iguana/dpow/dpow_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 3709aa0fc..8a10066fe 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1901,7 +1901,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru printf("mypaxcrc.%x\n",bp->paxwdcrc); } char str[65]; - if ( (rand() % 130) == 0 || strcmp(dp->symbol,"CHIPS") == 0 ) + if ( (rand() % 130) == 0 || strcmp(dp->symbol,"KMD") == 0 ) printf("%p ht.%d [%d] ips.%d %s NOTARIZE.%d matches.%d paxmatches.%d bestmatches.%d bestk.%d %llx recv.%llx sigmasks.(%llx %llx) senderind.%d state.%x (%x %x %x) MoM.%s [%d]\n",bp,bp->height,bp->myind,dp->numipbits,dp->symbol,bp->minsigs,matches,paxmatches,bestmatches,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask,(long long)(bp->bestk>=0?bp->destsigsmasks[bp->bestk]:0),(long long)(bp->bestk>=0?bp->srcsigsmasks[bp->bestk]:0),senderind,bp->state,bp->hashmsg.uints[0],bp->desttxid.uints[0],bp->srctxid.uints[0],bits256_str(str,bp->MoM),bp->MoMdepth); } } From 8cace94fab95fdb668d32a6759bcc065662b8640 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 13:05:16 +0300 Subject: [PATCH 44/98] Disable MoM --- iguana/dpow/dpow_fsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index a7fca399c..a6c1e59e8 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -294,7 +294,7 @@ int32_t dpow_txhasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supe decode_hex(script,len,hexstr); if ( dpow_opreturn_parsesrc(&blockhash,nothtp,&txid,symbol,&MoM,&MoMdepth,script,len,mdata) > 0 && strcmp(symbol,coin->symbol) == 0 ) { - // if ( Notaries_port != DPOW_SOCKPORT ) // keep going till valid MoM found, useful for new chains without any MoM + //if ( Notaries_port != DPOW_SOCKPORT ) // keep going till valid MoM found, useful for new chains without any MoM { if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 || *nothtp >= height || *nothtp < 0 ) { @@ -439,7 +439,7 @@ void dpow_statemachinestart(void *ptr) return; } MoMdepth = 0; - if ( strcmp(dp->dest,"KMD") == 0 ) + if ( 0 && strcmp(dp->dest,"KMD") == 0 ) { portable_mutex_lock(&src->MoM_mutex); MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); From 3b91f33ef0369266b03e48f968e1b3b3f68e8b7e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 13:05:51 +0300 Subject: [PATCH 45/98] Disable MoM --- iguana/dpow/dpow_fsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index a7fca399c..048c7197a 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -439,7 +439,7 @@ void dpow_statemachinestart(void *ptr) return; } MoMdepth = 0; - if ( strcmp(dp->dest,"KMD") == 0 ) + if ( 0 && strcmp(dp->dest,"KMD") == 0 ) { portable_mutex_lock(&src->MoM_mutex); MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); From 436a24d0b4620dbe8babc1e832ff1c78594444df Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 14:13:28 +0300 Subject: [PATCH 46/98] Fix syntax errors in coins --- iguana/exchanges/coins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index effe9c449..8970f6da2 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{"coin":"GLXT","asset":"GLXT","rpcport":15723}, {\"coin\":\"PYRO\",\"name\":\"pyro\",\"confpath\":\"${HOME#}/.pyrocore/pyro.conf\",\"rpcport\":9696,\"pubtype\":55,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\": \"BNTN\",\"asset\": \"BNTN\",\"rpcport\": 14358},{\"coin\":\"ORE\",\"name\":\"galactrum\",\"rpcport\":6269,\"pubtype\":38,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELD\",\"name\":\"maker\",\"etomic\":\"0xaaf7d4cd097317d68174215395eb02c2cca81e31\",\"rpcport\":80}, {\"coin\":\"CENNZ\",\"name\":\"centrality\",\"etomic\":\"0x1122b6a0e00dce0563082b6e2953f3a943855c1f\",\"rpcport\":80}, {\"coin\":\"PGN\",\"name\":\"pigeon\",\"rpcport\":8756,\"pubtype\":55,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCG\",\"name\":\"Xchange\",\"confpath\":\"${HOME#}/.Xchangecore/Xchange.conf\",\"rpcport\":9386,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"AXE\",\"name\":\"axe\",\"confpath\":\"${HOME#}/.axecore/axe.conf\",\"rpcport\":9337,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"PEW\",\"name\":\"brofist\",\"rpcport\":12454,\"pubtype\":55,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000,\"confpath\":\"${HOME#}/.brofistcore/brofist.conf\"}, {\"coin\":\"BCBC\",\"name\":\"bitcoin@cbc\",\"confpath\":\"${HOME#}/.bitcoin@cbc/bitcoin.conf\",\"rpcport\":8340,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"GRLC\",\"name\":\"garlicoin\",\"rpcport\":42068,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"EQL\",\"asset\":\"EQL\",\"rpcport\":10306}, {\"coin\":\"OCC\",\"name\":\"originalcryptocoin\",\"etomic\":\"0x0235fe624e044a05eed7a43e16e3083bc8a4287a\",\"rpcport\":80}, {\"coin\":\"DIN\",\"name\":\"dinero\",\"rpcport\":9998,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":204,\"txfee\":10000,\"confpath\":\"${HOME#}/.dinerocore/dinero.conf\"}, {\"coin\":\"BUCK\",\"name\":\"buck\",\"rpcport\":5739,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LYS\",\"name\":\"lightyears\",\"etomic\":\"0xdd41fbd1ae95c5d9b198174a28e04be6b3d1aa27\",\"rpcport\":80}, {\"coin\":\"RAP\",\"name\":\"rapture\",\"rpcport\":14776,\"pubtype\":60,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000,\"confpath\":\"${HOME#}/.rapturecore/rapture.conf\"}, {\"coin\":\"RADIUS\",\"name\":\"radius\",\"rpcport\":4089,\"pubtype\":60,\"p2shtype\":16,\"wiftype\":15,\"txfee\":10000,\"confpath\":\"${HOME#}/.radiuscore/radius.conf\"},{\"coin\":\"BTCL\",\"name\":\"btclite\",\"etomic\":\"0x5acd19b9c91e596b1f062f18e3d02da7ed8d1e50\",\"rpcport\":80}, {\"coin\":\"SEQ\",\"name\":\"sequence\",\"rpcport\":16663,\"isPoS\":1,\"pubtype\":63,\"p2shtype\":64,\"wiftype\":170,\"txfee\":10000}, {\"coin\":\"DYN\",\"name\":\"dynamic\",\"rpcport\":33350,\"pubtype\":30,\"p2shtype\":10,\"wiftype\":140,\"txfee\":10000}, {\"coin\":\"SBTC\",\"name\":\"SuperBitcoin\",\"rpcport\":28282,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000,\"confpath\":\"${HOME#}/.sbtc/sbtc.conf\"}, {\"coin\":\"FJC\",\"name\":\"fujicoin\",\"rpcport\":3776,\"pubtype\":36,\"p2shtype\":16,\"wiftype\":164,\"txfee\":100000}, {\"coin\":\"AIR\",\"name\":\"airtoken\",\"etomic\":\"0x27dce1ec4d3f72c3e457cc50354f1f975ddef488\",\"rpcport\":80}, {\"coin\":\"VRT\",\"name\":\"virtus\",\"confpath\":\"${HOME#}/.virtuscore/virtus.conf\",\"rpcport\":13880,\"pubtype\":70,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"DRT\",\"name\":\"domraider\",\"etomic\":\"0x9af4f26941677c706cfecf6d3379ff01bb85d5ab\",\"rpcport\":80}, {\"coin\":\"BITS\",\"name\":\"bitstar\",\"rpcport\":15715,\"isPoS\":1,\"pubtype\":25,\"p2shtype\":8,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"FTC\",\"name\":\"feathercoin\",\"rpcport\":9337,\"pubtype\":14,\"p2shtype\":5,\"wiftype\":142,\"txfee\":1000000}, {\"coin\":\"PXT\",\"name\":\"populous-xbrl-token\",\"etomic\":\"0xc14830e53aa344e8c14603a91229a0b925b0b262\",\"rpcport\":80}, {\"coin\":\"USDT\",\"name\":\"tether\",\"etomic\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"rpcport\":80}, {\"coin\":\"ELI\",\"name\":\"elicoin\",\"rpcport\":9332,\"pubtype\":33,\"p2shtype\":102,\"wiftype\":205,\"txfee\":10000}, {\"coin\":\"SCRIV\",\"name\":\"scriv\",\"confpath\":\"${HOME#}/.scrivcore/scriv.conf\",\"rpcport\":7998,\"pubtype\":125,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELP\",\"name\":\"ellerium\",\"rpcport\":61020,\"pubtype\":23,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"ROI\",\"name\":\"ROIcoin\",\"rpcport\":3376,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCOIN\",\"name\":\"xcoin\",\"rpcport\":22717,\"pubtype\":137,\"p2shtype\":15,\"wiftype\":75,\"txfee\":100000}, {\"coin\":\"BBT\",\"name\":\"bitboost\",\"etomic\":\"0x1500205f50bf3fd976466d0662905c9ff254fc9c\",\"rpcport\":80}, {\"coin\":\"TRX\",\"name\":\"tron\",\"etomic\":\"0xf230b790e05390fc8295f4d3f60332c93bed42e2\",\"rpcport\":80}, {\"coin\":\"OMG\",\"name\":\"omisego\",\"etomic\":\"0xd26114cd6EE289AccF82350c8d8487fedB8A0C07\",\"rpcport\":80}, {\"coin\":\"ICX\",\"name\":\"icon\",\"etomic\":\"0xb5a5f22694352c15b00323844ad545abb2b11028\",\"rpcport\":80}, {\"coin\":\"BNB\",\"name\":\"binance-coin\",\"etomic\":\"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\"rpcport\":80}, {\"coin\":\"DGD\",\"name\":\"digixdao\",\"etomic\":\"0xE0B7927c4aF23765Cb51314A0E0521A9645F0E2A\",\"rpcport\":80}, {\"coin\":\"PPT\",\"name\":\"populous\",\"etomic\":\"0xd4fa1460F537bb9085d22C7bcCB5DD450Ef28e3a\",\"rpcport\":80}, {\"coin\":\"MKR\",\"name\":\"maker\",\"etomic\":\"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2\",\"rpcport\":80}, {\"coin\":\"SNT\",\"name\":\"status\",\"etomic\":\"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E\",\"rpcport\":80}, {\"coin\":\"REP\",\"name\":\"augur\",\"etomic\":\"0xE94327D07Fc17907b4DB788E5aDf2ed424adDff6\",\"rpcport\":80}, {\"coin\":\"ZRX\",\"name\":\"0x\",\"etomic\":\"0xE41d2489571d322189246DaFA5ebDe1F4699F498\",\"rpcport\":80}, {\"coin\":\"BAT\",\"name\":\"basic-attention-token\",\"etomic\":\"0x0D8775F648430679A709E98d2b0Cb6250d2887EF\",\"rpcport\":80}, {\"coin\":\"GNT\",\"name\":\"golem\",\"etomic\":\"0xa74476443119A942dE498590Fe1f2454d7D4aC0d\",\"rpcport\":80}, {\"coin\":\"ETHOS\",\"name\":\"ethos\",\"etomic\":\"0x5Af2Be193a6ABCa9c8817001F45744777Db30756\",\"rpcport\":80}, {\"coin\":\"QASH\",\"name\":\"qash\",\"etomic\":\"0x618E75Ac90b12c6049Ba3b27f5d5F8651b0037F6\",\"rpcport\":80}, {\"coin\":\"FUN\",\"name\":\"funfair\",\"etomic\":\"0x419D0d8BdD9aF5e606Ae2232ed285Aff190E711b\",\"rpcport\":80}, {\"coin\":\"KNC\",\"name\":\"kyber-network\",\"etomic\":\"0xdd974D5C2e2928deA5F71b9825b8b646686BD200\",\"rpcport\":80}, {\"coin\":\"SALT\",\"name\":\"salt\",\"etomic\":\"0x4156D3342D5c385a87D264F90653733592000581\",\"rpcport\":80}, {\"coin\":\"BNT\",\"name\":\"bancor\",\"etomic\":\"0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C\",\"rpcport\":80}, {\"coin\":\"ICN\",\"name\":\"iconomi\",\"etomic\":\"0x888666CA69E0f178DED6D75b5726Cee99A87D698\",\"rpcport\":80}, {\"coin\":\"PAY\",\"name\":\"tenx\",\"etomic\":\"0xB97048628DB6B661D4C2aA833e95Dbe1A905B280\",\"rpcport\":80}, {\"coin\":\"REQ\",\"name\":\"request-network\",\"etomic\":\"0x8f8221aFbB33998d8584A2B05749bA73c37a938a\",\"rpcport\":80}, {\"coin\":\"STORJ\",\"name\":\"storj\",\"etomic\":\"0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC\",\"rpcport\":80}, {\"coin\":\"GNO\",\"name\":\"gnosis-gno\",\"etomic\":\"0x6810e776880C02933D47DB1b9fc05908e5386b96\",\"rpcport\":80}, {\"coin\":\"RLC\",\"name\":\"rlc\",\"etomic\":\"0x607F4C5BB672230e8672085532f7e901544a7375\",\"rpcport\":80}, {\"coin\":\"ENJ\",\"name\":\"enjin-coin\",\"etomic\":\"0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c\",\"rpcport\":80}, {\"coin\":\"QSP\",\"name\":\"quantstamp\",\"etomic\":\"0x99ea4dB9EE77ACD40B119BD1dC4E33e1C070b80d\",\"rpcport\":80}, {\"coin\":\"RDN\",\"name\":\"raiden-network-token\",\"etomic\":\"0x255Aa6DF07540Cb5d3d297f0D0D4D84cb52bc8e6\",\"rpcport\":80}, {\"coin\":\"CVC\",\"name\":\"civic\",\"etomic\":\"0x41e5560054824eA6B0732E656E3Ad64E20e94E45\",\"rpcport\":80}, {\"coin\":\"SAN\",\"name\":\"santiment\",\"etomic\":\"0x7C5A0CE9267ED19B22F8cae653F198e3E8daf098\",\"rpcport\":80}, {\"coin\":\"ANT\",\"name\":\"aragon\",\"etomic\":\"0x960b236A07cf122663c4303350609A66A7B288C0\",\"rpcport\":80}, {\"coin\":\"MANA\",\"name\":\"decentraland\",\"etomic\":\"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942\",\"rpcport\":80}, {\"coin\":\"MCO\",\"name\":\"monaco\",\"etomic\":\"0xB63B606Ac810a52cCa15e44bB630fd42D8d1d83d\",\"rpcport\":80}, {\"coin\":\"MTL\",\"name\":\"metal\",\"etomic\":\"0xF433089366899D83a9f26A773D59ec7eCF30355e\",\"rpcport\":80}, {\"coin\":\"EDG\",\"name\":\"edgeless\",\"etomic\":\"0x08711D3B02C8758F2FB3ab4e80228418a7F8e39c\",\"rpcport\":80}, {\"coin\":\"MLN\",\"name\":\"melon\",\"etomic\":\"0xBEB9eF514a379B997e0798FDcC901Ee474B6D9A1\",\"rpcport\":80}, {\"coin\":\"AMB\",\"name\":\"amber\",\"etomic\":\"0x4DC3643DbC642b72C158E7F3d2ff232df61cb6CE\",\"rpcport\":80}, {\"coin\":\"WINGS\",\"name\":\"wings\",\"etomic\":\"0x667088b212ce3d06a1b553a7221E1fD19000d9aF\",\"rpcport\":80}, {\"coin\":\"RCN\",\"name\":\"ripio-credit-network\",\"etomic\":\"0xF970b8E36e23F7fC3FD752EeA86f8Be8D83375A6\",\"rpcport\":80}, {\"coin\":\"SNGLS\",\"name\":\"singulardtv\",\"etomic\":\"0xaeC2E87E0A235266D9C5ADc9DEb4b2E29b54D009\",\"rpcport\":80}, {\"coin\":\"TAAS\",\"name\":\"taas\",\"etomic\":\"0xE7775A6e9Bcf904eb39DA2b68c5efb4F9360e08C\",\"rpcport\":80}, {\"coin\":\"DNT\",\"name\":\"district0x\",\"etomic\":\"0x0AbdAce70D3790235af448C88547603b945604ea\",\"rpcport\":80}, {\"coin\":\"CFI\",\"name\":\"cofound-it\",\"etomic\":\"0x12FEF5e57bF45873Cd9B62E9DBd7BFb99e32D73e\",\"rpcport\":80}, {\"coin\":\"LUN\",\"name\":\"lunyr\",\"etomic\":\"0xfa05A73FfE78ef8f1a739473e462c54bae6567D9\",\"rpcport\":80}, {\"coin\":\"ADT\",\"name\":\"adtoken\",\"etomic\":\"0xD0D6D6C5Fe4a677D343cC433536BB717bAe167dD\",\"rpcport\":80}, {\"coin\":\"AST\",\"name\":\"airswap\",\"etomic\":\"0x27054b13b1B798B345b591a4d22e6562d47eA75a\",\"rpcport\":80}, {\"coin\":\"CDT\",\"name\":\"blox\",\"etomic\":\"0x177d39AC676ED1C67A2b268AD7F1E58826E5B0af\",\"rpcport\":80}, {\"coin\":\"TKN\",\"name\":\"tokencard\",\"etomic\":\"0xaAAf91D9b90dF800Df4F55c205fd6989c977E73a\",\"rpcport\":80}, {\"coin\":\"HMQ\",\"name\":\"humaniq\",\"etomic\":\"0xcbCC0F036ED4788F63FC0fEE32873d6A7487b908\",\"rpcport\":80}, {\"coin\":\"BCAP\",\"name\":\"bcap\",\"etomic\":\"0xFf3519eeeEA3e76F1F699CCcE5E23ee0bdDa41aC\",\"rpcport\":80}, {\"coin\":\"NMR\",\"name\":\"numeraire\",\"etomic\":\"0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671\",\"rpcport\":80}, {\"coin\":\"NET\",\"name\":\"nimiq\",\"etomic\":\"0xcfb98637bcae43C13323EAa1731cED2B716962fD\",\"rpcport\":80}, {\"coin\":\"TRST\",\"name\":\"trust\",\"etomic\":\"0xCb94be6f13A1182E4A4B6140cb7bf2025d28e41B\",\"rpcport\":80}, {\"coin\":\"GUP\",\"name\":\"guppy\",\"etomic\":\"0xf7B098298f7C69Fc14610bf71d5e02c60792894C\",\"rpcport\":80}, {\"coin\":\"1ST\",\"name\":\"firstblood\",\"etomic\":\"0xAf30D2a7E90d7DC361c8C4585e9BB7D2F6f15bc7\",\"rpcport\":80}, {\"coin\":\"TIME\",\"name\":\"chronobank\",\"etomic\":\"0x6531f133e6DeeBe7F2dcE5A0441aA7ef330B4e53\",\"rpcport\":80}, {\"coin\":\"SWT\",\"name\":\"swarm-city\",\"etomic\":\"0xB9e7F8568e08d5659f5D29C4997173d84CdF2607\",\"rpcport\":80}, {\"coin\":\"ROL\",\"name\":\"dice\",\"etomic\":\"0x2e071D2966Aa7D8dECB1005885bA1977D6038A65\",\"rpcport\":80}, {\"coin\":\"XAUR\",\"name\":\"xaurum\",\"etomic\":\"0x4DF812F6064def1e5e029f1ca858777CC98D2D81\",\"rpcport\":80}, {\"coin\":\"PLU\",\"name\":\"pluton\",\"etomic\":\"0xD8912C10681D8B21Fd3742244f44658dBA12264E\",\"rpcport\":80}, {\"coin\":\"HGT\",\"name\":\"hellogold\",\"etomic\":\"0xba2184520A1cC49a6159c57e61E1844E085615B6\",\"rpcport\":80}, {\"coin\":\"VSL\",\"name\":\"vslice\",\"etomic\":\"0x5c543e7AE0A1104f78406C340E9C64FD9fCE5170\",\"rpcport\":80}, {\"coin\":\"IND\",\"name\":\"indorse-token\",\"etomic\":\"0xf8e386EDa857484f5a12e4B5DAa9984E06E73705\",\"rpcport\":80}, {\"coin\":\"FYN\",\"name\":\"fundyourselfnow\",\"etomic\":\"0x88FCFBc22C6d3dBaa25aF478C578978339BDe77a\",\"rpcport\":80},{\"coin\":\"SMART\",\"name\":\"smartcash\",\"rpcport\":9679,\"pubtype\":63,\"p2shtype\":18,\"wiftype\":191,\"txfee\":200000}, {\"coin\":\"BTCP\",\"name\":\"btcprivate\",\"rpcport\":7932,\"taddr\":19,\"pubtype\":37,\"p2shtype\":175,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DNR\",\"isPoS\":1,\"active\":1,\"name\":\"denarius\",\"rpcport\":32339,\"pubtype\":30,\"p2shtype\":90,\"wiftype\":158,\"txfee\":10000}, {\"coin\":\"RVN\",\"name\":\"raven\",\"rpcport\":8766,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"VIVO\",\"name\":\"vivo\",\"confpath\":\"${HOME#}/.vivocore/vivo.conf\",\"rpcport\":9998,\"pubtype\":70,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"KNG\",\"name\":\"kings\",\"rpcport\":44888,\"pubtype\":75,\"p2shtype\":125,\"wiftype\":203,\"txfee\":10000}, {\"coin\":\"UFO\",\"name\":\"ufocoin\",\"confpath\":\"${HOME#}/.ufo/ufocoin.conf\",\"rpcport\":9888,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":155,\"txfee\":100000}, {\"coin\":\"ETH\",\"name\":\"ethereum\",\"etomic\":\"0x0000000000000000000000000000000000000000\",\"rpcport\":80}, {\"coin\":\"EOS\",\"name\":\"EOS\",\"etomic\":\"0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0\",\"rpcport\":80}, {\"coin\":\"KREDS\",\"name\":\"kreds\",\"rpcport\":3850,\"pubtype\":45,\"p2shtype\":5,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"SNG\",\"name\":\"snowgem\",\"rpcport\":16112,\"taddr\":28,\"pubtype\":40,\"p2shtype\":45,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"ZEL\",\"name\":\"zelcash\",\"rpcport\":16124,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"HTML\",\"name\":\"htmlcoin\",\"rpcport\":4889,\"pubtype\":41,\"p2shtype\":100,\"wiftype\":169,\"txfee\":400000}, {\"coin\":\"MNX\",\"name\":\"Minexcoin\",\"rpcport\":17786,\"pubtype\":75,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LTZ\",\"name\":\"litecoinz\",\"rpcport\":29332,\"taddr\":10,\"pubtype\":179,\"p2shtype\":184,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BAY\",\"name\":\"bitbay\",\"isPoS\":1,\"rpcport\":19915,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"OOT\",\"asset\":\"OOT\",\"rpcport\":12467}, {\"coin\":\"ZOI\",\"name\":\"zoin\",\"rpcport\":8255,\"pubtype\":80,\"p2shtype\":7,\"wiftype\":208,\"txfee\":1000}, {\"coin\": \"PIZZA\",\"asset\": \"PIZZA\",\"rpcport\": 11116},{\"coin\": \"BEER\",\"asset\": \"BEER\",\"rpcport\": 8923}, {\"coin\":\"GRS\",\"name\":\"groestlcoin\",\"rpcport\":1441,\"pubtype\":36,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XMCC\",\"name\":\"monoeci\",\"confpath\":\"${HOME#}/.monoeciCore/monoeci.conf\",\"rpcport\":24156,\"pubtype\":50,\"p2shtype\":73,\"wiftype\":77,\"txfee\":10000}, {\"coin\":\"BTCH\",\"asset\":\"BTCH\",\"rpcport\":8800},{\"coin\":\"ETOMIC\",\"asset\":\"ETOMIC\",\"rpcport\":10271},{\"coin\":\"AXO\",\"asset\":\"AXO\",\"rpcport\":12927},{\"coin\":\"CRC\",\"name\":\"crowdcoin\",\"confpath\":\"${HOME#}/.crowdcoincore/crowdcoin.conf\",\"rpcport\":11998,\"pubtype\":28,\"p2shtype\":88,\"wiftype\":0,\"txfee\":10000}, {\"coin\":\"VOT\",\"name\":\"votecoin\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"INN\",\"name\":\"innova\",\"confpath\":\"${HOME#}/.innovacore/innova.conf\",\"rpcport\":8818,\"pubtype\":102,\"p2shtype\":20,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":28,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"EFL\",\"name\":\"egulden\",\"confpath\":\"${HOME#}/.egulden/coin.conf\",\"rpcport\":21015,\"pubtype\":48,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"GBX\",\"name\":\"gobyte\",\"confpath\":\"${HOME#}/.gobytecore/gobyte.conf\",\"rpcport\":12454,\"pubtype\":38,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"BCO\",\"name\":\"bridgecoin\",\"rpcport\":6332,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"confpath\":\"${HOME#}/.lore/blackcoin.conf\",\"isPoS\":1,\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":100000}, {\"coin\":\"BTG\",\"name\":\"bitcoingold\",\"rpcport\":8332,\"pubtype\":38,\"p2shtype\":23,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BCH\",\"name\":\"bch\",\"rpcport\":33333,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"ABY\",\"name\":\"applebyte\",\"rpcport\":8607,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":100000}, {\"coin\":\"STAK\",\"name\":\"straks\",\"rpcport\":7574,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"XZC\",\"name\":\"zcoin\",\"rpcport\":8888,\"pubtype\":82,\"p2shtype\":7,\"wiftype\":210,\"txfee\":10000}, {\"coin\":\"QTUM\",\"name\":\"qtum\",\"rpcport\":3889,\"pubtype\":58,\"p2shtype\":50,\"wiftype\":128,\"txfee\":400000}, {\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":100000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":10000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"MSHARK\",\"asset\":\"MSHARK\",\"rpcport\":8846}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{\"coin\":\"GLXT\",\"asset\":\"GLXT\",\"rpcport\":15723}, {\"coin\":\"PYRO\",\"name\":\"pyro\",\"confpath\":\"${HOME#}/.pyrocore/pyro.conf\",\"rpcport\":9696,\"pubtype\":55,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\": \"BNTN\",\"asset\": \"BNTN\",\"rpcport\": 14358},{\"coin\":\"ORE\",\"name\":\"galactrum\",\"rpcport\":6269,\"pubtype\":38,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELD\",\"name\":\"maker\",\"etomic\":\"0xaaf7d4cd097317d68174215395eb02c2cca81e31\",\"rpcport\":80}, {\"coin\":\"CENNZ\",\"name\":\"centrality\",\"etomic\":\"0x1122b6a0e00dce0563082b6e2953f3a943855c1f\",\"rpcport\":80}, {\"coin\":\"PGN\",\"name\":\"pigeon\",\"rpcport\":8756,\"pubtype\":55,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCG\",\"name\":\"Xchange\",\"confpath\":\"${HOME#}/.Xchangecore/Xchange.conf\",\"rpcport\":9386,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"AXE\",\"name\":\"axe\",\"confpath\":\"${HOME#}/.axecore/axe.conf\",\"rpcport\":9337,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"PEW\",\"name\":\"brofist\",\"rpcport\":12454,\"pubtype\":55,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000,\"confpath\":\"${HOME#}/.brofistcore/brofist.conf\"}, {\"coin\":\"BCBC\",\"name\":\"bitcoin@cbc\",\"confpath\":\"${HOME#}/.bitcoin@cbc/bitcoin.conf\",\"rpcport\":8340,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"GRLC\",\"name\":\"garlicoin\",\"rpcport\":42068,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"EQL\",\"asset\":\"EQL\",\"rpcport\":10306}, {\"coin\":\"OCC\",\"name\":\"originalcryptocoin\",\"etomic\":\"0x0235fe624e044a05eed7a43e16e3083bc8a4287a\",\"rpcport\":80}, {\"coin\":\"DIN\",\"name\":\"dinero\",\"rpcport\":9998,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":204,\"txfee\":10000,\"confpath\":\"${HOME#}/.dinerocore/dinero.conf\"}, {\"coin\":\"BUCK\",\"name\":\"buck\",\"rpcport\":5739,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LYS\",\"name\":\"lightyears\",\"etomic\":\"0xdd41fbd1ae95c5d9b198174a28e04be6b3d1aa27\",\"rpcport\":80}, {\"coin\":\"RAP\",\"name\":\"rapture\",\"rpcport\":14776,\"pubtype\":60,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000,\"confpath\":\"${HOME#}/.rapturecore/rapture.conf\"}, {\"coin\":\"RADIUS\",\"name\":\"radius\",\"rpcport\":4089,\"pubtype\":60,\"p2shtype\":16,\"wiftype\":15,\"txfee\":10000,\"confpath\":\"${HOME#}/.radiuscore/radius.conf\"},{\"coin\":\"BTCL\",\"name\":\"btclite\",\"etomic\":\"0x5acd19b9c91e596b1f062f18e3d02da7ed8d1e50\",\"rpcport\":80}, {\"coin\":\"SEQ\",\"name\":\"sequence\",\"rpcport\":16663,\"isPoS\":1,\"pubtype\":63,\"p2shtype\":64,\"wiftype\":170,\"txfee\":10000}, {\"coin\":\"DYN\",\"name\":\"dynamic\",\"rpcport\":33350,\"pubtype\":30,\"p2shtype\":10,\"wiftype\":140,\"txfee\":10000}, {\"coin\":\"SBTC\",\"name\":\"SuperBitcoin\",\"rpcport\":28282,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000,\"confpath\":\"${HOME#}/.sbtc/sbtc.conf\"}, {\"coin\":\"FJC\",\"name\":\"fujicoin\",\"rpcport\":3776,\"pubtype\":36,\"p2shtype\":16,\"wiftype\":164,\"txfee\":100000}, {\"coin\":\"AIR\",\"name\":\"airtoken\",\"etomic\":\"0x27dce1ec4d3f72c3e457cc50354f1f975ddef488\",\"rpcport\":80}, {\"coin\":\"VRT\",\"name\":\"virtus\",\"confpath\":\"${HOME#}/.virtuscore/virtus.conf\",\"rpcport\":13880,\"pubtype\":70,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"DRT\",\"name\":\"domraider\",\"etomic\":\"0x9af4f26941677c706cfecf6d3379ff01bb85d5ab\",\"rpcport\":80}, {\"coin\":\"BITS\",\"name\":\"bitstar\",\"rpcport\":15715,\"isPoS\":1,\"pubtype\":25,\"p2shtype\":8,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"FTC\",\"name\":\"feathercoin\",\"rpcport\":9337,\"pubtype\":14,\"p2shtype\":5,\"wiftype\":142,\"txfee\":1000000}, {\"coin\":\"PXT\",\"name\":\"populous-xbrl-token\",\"etomic\":\"0xc14830e53aa344e8c14603a91229a0b925b0b262\",\"rpcport\":80}, {\"coin\":\"USDT\",\"name\":\"tether\",\"etomic\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"rpcport\":80}, {\"coin\":\"ELI\",\"name\":\"elicoin\",\"rpcport\":9332,\"pubtype\":33,\"p2shtype\":102,\"wiftype\":205,\"txfee\":10000}, {\"coin\":\"SCRIV\",\"name\":\"scriv\",\"confpath\":\"${HOME#}/.scrivcore/scriv.conf\",\"rpcport\":7998,\"pubtype\":125,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELP\",\"name\":\"ellerium\",\"rpcport\":61020,\"pubtype\":23,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"ROI\",\"name\":\"ROIcoin\",\"rpcport\":3376,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCOIN\",\"name\":\"xcoin\",\"rpcport\":22717,\"pubtype\":137,\"p2shtype\":15,\"wiftype\":75,\"txfee\":100000}, {\"coin\":\"BBT\",\"name\":\"bitboost\",\"etomic\":\"0x1500205f50bf3fd976466d0662905c9ff254fc9c\",\"rpcport\":80}, {\"coin\":\"TRX\",\"name\":\"tron\",\"etomic\":\"0xf230b790e05390fc8295f4d3f60332c93bed42e2\",\"rpcport\":80}, {\"coin\":\"OMG\",\"name\":\"omisego\",\"etomic\":\"0xd26114cd6EE289AccF82350c8d8487fedB8A0C07\",\"rpcport\":80}, {\"coin\":\"ICX\",\"name\":\"icon\",\"etomic\":\"0xb5a5f22694352c15b00323844ad545abb2b11028\",\"rpcport\":80}, {\"coin\":\"BNB\",\"name\":\"binance-coin\",\"etomic\":\"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\"rpcport\":80}, {\"coin\":\"DGD\",\"name\":\"digixdao\",\"etomic\":\"0xE0B7927c4aF23765Cb51314A0E0521A9645F0E2A\",\"rpcport\":80}, {\"coin\":\"PPT\",\"name\":\"populous\",\"etomic\":\"0xd4fa1460F537bb9085d22C7bcCB5DD450Ef28e3a\",\"rpcport\":80}, {\"coin\":\"MKR\",\"name\":\"maker\",\"etomic\":\"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2\",\"rpcport\":80}, {\"coin\":\"SNT\",\"name\":\"status\",\"etomic\":\"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E\",\"rpcport\":80}, {\"coin\":\"REP\",\"name\":\"augur\",\"etomic\":\"0xE94327D07Fc17907b4DB788E5aDf2ed424adDff6\",\"rpcport\":80}, {\"coin\":\"ZRX\",\"name\":\"0x\",\"etomic\":\"0xE41d2489571d322189246DaFA5ebDe1F4699F498\",\"rpcport\":80}, {\"coin\":\"BAT\",\"name\":\"basic-attention-token\",\"etomic\":\"0x0D8775F648430679A709E98d2b0Cb6250d2887EF\",\"rpcport\":80}, {\"coin\":\"GNT\",\"name\":\"golem\",\"etomic\":\"0xa74476443119A942dE498590Fe1f2454d7D4aC0d\",\"rpcport\":80}, {\"coin\":\"ETHOS\",\"name\":\"ethos\",\"etomic\":\"0x5Af2Be193a6ABCa9c8817001F45744777Db30756\",\"rpcport\":80}, {\"coin\":\"QASH\",\"name\":\"qash\",\"etomic\":\"0x618E75Ac90b12c6049Ba3b27f5d5F8651b0037F6\",\"rpcport\":80}, {\"coin\":\"FUN\",\"name\":\"funfair\",\"etomic\":\"0x419D0d8BdD9aF5e606Ae2232ed285Aff190E711b\",\"rpcport\":80}, {\"coin\":\"KNC\",\"name\":\"kyber-network\",\"etomic\":\"0xdd974D5C2e2928deA5F71b9825b8b646686BD200\",\"rpcport\":80}, {\"coin\":\"SALT\",\"name\":\"salt\",\"etomic\":\"0x4156D3342D5c385a87D264F90653733592000581\",\"rpcport\":80}, {\"coin\":\"BNT\",\"name\":\"bancor\",\"etomic\":\"0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C\",\"rpcport\":80}, {\"coin\":\"ICN\",\"name\":\"iconomi\",\"etomic\":\"0x888666CA69E0f178DED6D75b5726Cee99A87D698\",\"rpcport\":80}, {\"coin\":\"PAY\",\"name\":\"tenx\",\"etomic\":\"0xB97048628DB6B661D4C2aA833e95Dbe1A905B280\",\"rpcport\":80}, {\"coin\":\"REQ\",\"name\":\"request-network\",\"etomic\":\"0x8f8221aFbB33998d8584A2B05749bA73c37a938a\",\"rpcport\":80}, {\"coin\":\"STORJ\",\"name\":\"storj\",\"etomic\":\"0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC\",\"rpcport\":80}, {\"coin\":\"GNO\",\"name\":\"gnosis-gno\",\"etomic\":\"0x6810e776880C02933D47DB1b9fc05908e5386b96\",\"rpcport\":80}, {\"coin\":\"RLC\",\"name\":\"rlc\",\"etomic\":\"0x607F4C5BB672230e8672085532f7e901544a7375\",\"rpcport\":80}, {\"coin\":\"ENJ\",\"name\":\"enjin-coin\",\"etomic\":\"0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c\",\"rpcport\":80}, {\"coin\":\"QSP\",\"name\":\"quantstamp\",\"etomic\":\"0x99ea4dB9EE77ACD40B119BD1dC4E33e1C070b80d\",\"rpcport\":80}, {\"coin\":\"RDN\",\"name\":\"raiden-network-token\",\"etomic\":\"0x255Aa6DF07540Cb5d3d297f0D0D4D84cb52bc8e6\",\"rpcport\":80}, {\"coin\":\"CVC\",\"name\":\"civic\",\"etomic\":\"0x41e5560054824eA6B0732E656E3Ad64E20e94E45\",\"rpcport\":80}, {\"coin\":\"SAN\",\"name\":\"santiment\",\"etomic\":\"0x7C5A0CE9267ED19B22F8cae653F198e3E8daf098\",\"rpcport\":80}, {\"coin\":\"ANT\",\"name\":\"aragon\",\"etomic\":\"0x960b236A07cf122663c4303350609A66A7B288C0\",\"rpcport\":80}, {\"coin\":\"MANA\",\"name\":\"decentraland\",\"etomic\":\"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942\",\"rpcport\":80}, {\"coin\":\"MCO\",\"name\":\"monaco\",\"etomic\":\"0xB63B606Ac810a52cCa15e44bB630fd42D8d1d83d\",\"rpcport\":80}, {\"coin\":\"MTL\",\"name\":\"metal\",\"etomic\":\"0xF433089366899D83a9f26A773D59ec7eCF30355e\",\"rpcport\":80}, {\"coin\":\"EDG\",\"name\":\"edgeless\",\"etomic\":\"0x08711D3B02C8758F2FB3ab4e80228418a7F8e39c\",\"rpcport\":80}, {\"coin\":\"MLN\",\"name\":\"melon\",\"etomic\":\"0xBEB9eF514a379B997e0798FDcC901Ee474B6D9A1\",\"rpcport\":80}, {\"coin\":\"AMB\",\"name\":\"amber\",\"etomic\":\"0x4DC3643DbC642b72C158E7F3d2ff232df61cb6CE\",\"rpcport\":80}, {\"coin\":\"WINGS\",\"name\":\"wings\",\"etomic\":\"0x667088b212ce3d06a1b553a7221E1fD19000d9aF\",\"rpcport\":80}, {\"coin\":\"RCN\",\"name\":\"ripio-credit-network\",\"etomic\":\"0xF970b8E36e23F7fC3FD752EeA86f8Be8D83375A6\",\"rpcport\":80}, {\"coin\":\"SNGLS\",\"name\":\"singulardtv\",\"etomic\":\"0xaeC2E87E0A235266D9C5ADc9DEb4b2E29b54D009\",\"rpcport\":80}, {\"coin\":\"TAAS\",\"name\":\"taas\",\"etomic\":\"0xE7775A6e9Bcf904eb39DA2b68c5efb4F9360e08C\",\"rpcport\":80}, {\"coin\":\"DNT\",\"name\":\"district0x\",\"etomic\":\"0x0AbdAce70D3790235af448C88547603b945604ea\",\"rpcport\":80}, {\"coin\":\"CFI\",\"name\":\"cofound-it\",\"etomic\":\"0x12FEF5e57bF45873Cd9B62E9DBd7BFb99e32D73e\",\"rpcport\":80}, {\"coin\":\"LUN\",\"name\":\"lunyr\",\"etomic\":\"0xfa05A73FfE78ef8f1a739473e462c54bae6567D9\",\"rpcport\":80}, {\"coin\":\"ADT\",\"name\":\"adtoken\",\"etomic\":\"0xD0D6D6C5Fe4a677D343cC433536BB717bAe167dD\",\"rpcport\":80}, {\"coin\":\"AST\",\"name\":\"airswap\",\"etomic\":\"0x27054b13b1B798B345b591a4d22e6562d47eA75a\",\"rpcport\":80}, {\"coin\":\"CDT\",\"name\":\"blox\",\"etomic\":\"0x177d39AC676ED1C67A2b268AD7F1E58826E5B0af\",\"rpcport\":80}, {\"coin\":\"TKN\",\"name\":\"tokencard\",\"etomic\":\"0xaAAf91D9b90dF800Df4F55c205fd6989c977E73a\",\"rpcport\":80}, {\"coin\":\"HMQ\",\"name\":\"humaniq\",\"etomic\":\"0xcbCC0F036ED4788F63FC0fEE32873d6A7487b908\",\"rpcport\":80}, {\"coin\":\"BCAP\",\"name\":\"bcap\",\"etomic\":\"0xFf3519eeeEA3e76F1F699CCcE5E23ee0bdDa41aC\",\"rpcport\":80}, {\"coin\":\"NMR\",\"name\":\"numeraire\",\"etomic\":\"0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671\",\"rpcport\":80}, {\"coin\":\"NET\",\"name\":\"nimiq\",\"etomic\":\"0xcfb98637bcae43C13323EAa1731cED2B716962fD\",\"rpcport\":80}, {\"coin\":\"TRST\",\"name\":\"trust\",\"etomic\":\"0xCb94be6f13A1182E4A4B6140cb7bf2025d28e41B\",\"rpcport\":80}, {\"coin\":\"GUP\",\"name\":\"guppy\",\"etomic\":\"0xf7B098298f7C69Fc14610bf71d5e02c60792894C\",\"rpcport\":80}, {\"coin\":\"1ST\",\"name\":\"firstblood\",\"etomic\":\"0xAf30D2a7E90d7DC361c8C4585e9BB7D2F6f15bc7\",\"rpcport\":80}, {\"coin\":\"TIME\",\"name\":\"chronobank\",\"etomic\":\"0x6531f133e6DeeBe7F2dcE5A0441aA7ef330B4e53\",\"rpcport\":80}, {\"coin\":\"SWT\",\"name\":\"swarm-city\",\"etomic\":\"0xB9e7F8568e08d5659f5D29C4997173d84CdF2607\",\"rpcport\":80}, {\"coin\":\"ROL\",\"name\":\"dice\",\"etomic\":\"0x2e071D2966Aa7D8dECB1005885bA1977D6038A65\",\"rpcport\":80}, {\"coin\":\"XAUR\",\"name\":\"xaurum\",\"etomic\":\"0x4DF812F6064def1e5e029f1ca858777CC98D2D81\",\"rpcport\":80}, {\"coin\":\"PLU\",\"name\":\"pluton\",\"etomic\":\"0xD8912C10681D8B21Fd3742244f44658dBA12264E\",\"rpcport\":80}, {\"coin\":\"HGT\",\"name\":\"hellogold\",\"etomic\":\"0xba2184520A1cC49a6159c57e61E1844E085615B6\",\"rpcport\":80}, {\"coin\":\"VSL\",\"name\":\"vslice\",\"etomic\":\"0x5c543e7AE0A1104f78406C340E9C64FD9fCE5170\",\"rpcport\":80}, {\"coin\":\"IND\",\"name\":\"indorse-token\",\"etomic\":\"0xf8e386EDa857484f5a12e4B5DAa9984E06E73705\",\"rpcport\":80}, {\"coin\":\"FYN\",\"name\":\"fundyourselfnow\",\"etomic\":\"0x88FCFBc22C6d3dBaa25aF478C578978339BDe77a\",\"rpcport\":80},{\"coin\":\"SMART\",\"name\":\"smartcash\",\"rpcport\":9679,\"pubtype\":63,\"p2shtype\":18,\"wiftype\":191,\"txfee\":200000}, {\"coin\":\"BTCP\",\"name\":\"btcprivate\",\"rpcport\":7932,\"taddr\":19,\"pubtype\":37,\"p2shtype\":175,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DNR\",\"isPoS\":1,\"active\":1,\"name\":\"denarius\",\"rpcport\":32339,\"pubtype\":30,\"p2shtype\":90,\"wiftype\":158,\"txfee\":10000}, {\"coin\":\"RVN\",\"name\":\"raven\",\"rpcport\":8766,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"VIVO\",\"name\":\"vivo\",\"confpath\":\"${HOME#}/.vivocore/vivo.conf\",\"rpcport\":9998,\"pubtype\":70,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"KNG\",\"name\":\"kings\",\"rpcport\":44888,\"pubtype\":75,\"p2shtype\":125,\"wiftype\":203,\"txfee\":10000}, {\"coin\":\"UFO\",\"name\":\"ufocoin\",\"confpath\":\"${HOME#}/.ufo/ufocoin.conf\",\"rpcport\":9888,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":155,\"txfee\":100000}, {\"coin\":\"ETH\",\"name\":\"ethereum\",\"etomic\":\"0x0000000000000000000000000000000000000000\",\"rpcport\":80}, {\"coin\":\"EOS\",\"name\":\"EOS\",\"etomic\":\"0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0\",\"rpcport\":80}, {\"coin\":\"KREDS\",\"name\":\"kreds\",\"rpcport\":3850,\"pubtype\":45,\"p2shtype\":5,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"SNG\",\"name\":\"snowgem\",\"rpcport\":16112,\"taddr\":28,\"pubtype\":40,\"p2shtype\":45,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"ZEL\",\"name\":\"zelcash\",\"rpcport\":16124,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"HTML\",\"name\":\"htmlcoin\",\"rpcport\":4889,\"pubtype\":41,\"p2shtype\":100,\"wiftype\":169,\"txfee\":400000}, {\"coin\":\"MNX\",\"name\":\"Minexcoin\",\"rpcport\":17786,\"pubtype\":75,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LTZ\",\"name\":\"litecoinz\",\"rpcport\":29332,\"taddr\":10,\"pubtype\":179,\"p2shtype\":184,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BAY\",\"name\":\"bitbay\",\"isPoS\":1,\"rpcport\":19915,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"OOT\",\"asset\":\"OOT\",\"rpcport\":12467}, {\"coin\":\"ZOI\",\"name\":\"zoin\",\"rpcport\":8255,\"pubtype\":80,\"p2shtype\":7,\"wiftype\":208,\"txfee\":1000}, {\"coin\": \"PIZZA\",\"asset\": \"PIZZA\",\"rpcport\": 11116},{\"coin\": \"BEER\",\"asset\": \"BEER\",\"rpcport\": 8923}, {\"coin\":\"GRS\",\"name\":\"groestlcoin\",\"rpcport\":1441,\"pubtype\":36,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XMCC\",\"name\":\"monoeci\",\"confpath\":\"${HOME#}/.monoeciCore/monoeci.conf\",\"rpcport\":24156,\"pubtype\":50,\"p2shtype\":73,\"wiftype\":77,\"txfee\":10000}, {\"coin\":\"BTCH\",\"asset\":\"BTCH\",\"rpcport\":8800},{\"coin\":\"ETOMIC\",\"asset\":\"ETOMIC\",\"rpcport\":10271},{\"coin\":\"AXO\",\"asset\":\"AXO\",\"rpcport\":12927},{\"coin\":\"CRC\",\"name\":\"crowdcoin\",\"confpath\":\"${HOME#}/.crowdcoincore/crowdcoin.conf\",\"rpcport\":11998,\"pubtype\":28,\"p2shtype\":88,\"wiftype\":0,\"txfee\":10000}, {\"coin\":\"VOT\",\"name\":\"votecoin\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"INN\",\"name\":\"innova\",\"confpath\":\"${HOME#}/.innovacore/innova.conf\",\"rpcport\":8818,\"pubtype\":102,\"p2shtype\":20,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":28,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"EFL\",\"name\":\"egulden\",\"confpath\":\"${HOME#}/.egulden/coin.conf\",\"rpcport\":21015,\"pubtype\":48,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"GBX\",\"name\":\"gobyte\",\"confpath\":\"${HOME#}/.gobytecore/gobyte.conf\",\"rpcport\":12454,\"pubtype\":38,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"BCO\",\"name\":\"bridgecoin\",\"rpcport\":6332,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"confpath\":\"${HOME#}/.lore/blackcoin.conf\",\"isPoS\":1,\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":100000}, {\"coin\":\"BTG\",\"name\":\"bitcoingold\",\"rpcport\":8332,\"pubtype\":38,\"p2shtype\":23,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BCH\",\"name\":\"bch\",\"rpcport\":33333,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"ABY\",\"name\":\"applebyte\",\"rpcport\":8607,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":100000}, {\"coin\":\"STAK\",\"name\":\"straks\",\"rpcport\":7574,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"XZC\",\"name\":\"zcoin\",\"rpcport\":8888,\"pubtype\":82,\"p2shtype\":7,\"wiftype\":210,\"txfee\":10000}, {\"coin\":\"QTUM\",\"name\":\"qtum\",\"rpcport\":3889,\"pubtype\":58,\"p2shtype\":50,\"wiftype\":128,\"txfee\":400000}, {\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":100000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":10000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"MSHARK\",\"asset\":\"MSHARK\",\"rpcport\":8846}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" From de7b325ef3fb99f5748aa158a44b4162accd1543 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 14:31:37 +0300 Subject: [PATCH 47/98] Disable unspents cache --- iguana/exchanges/LP_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 0feb9069e..eef766620 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -619,6 +619,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON else if ( G.LP_pendingswaps != 0 && time(NULL) > ap->unspenttime+13 ) usecache = 0; } + usecache = 0; // disable unspents cache if ( usecache == 0 || electrumflag > 1 ) { if ( strcmp(symbol,"BCH") == 0 ) From 0e5da6be75dde6b776f868168097501a4c7001b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 14:51:28 +0300 Subject: [PATCH 48/98] +debug --- iguana/exchanges/LP_signatures.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 9454e63ec..de3702076 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -459,7 +459,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re char *LP_postprice_recv(cJSON *argjson) { - bits256 pubkey; double price; char *base,*rel,*argstr; + bits256 pubkey; double price; uint8_t pubkey33[33]; char *base,*rel,*argstr,coinaddr[64]; //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { @@ -482,7 +482,12 @@ char *LP_postprice_recv(cJSON *argjson) } else { - printf("sig failure.(%s)\n",jprint(argjson,0)); + if ( jstr(argjson,"pubsecp") != 0 ) + { + decode_hex(pubkey33,33,jstr(argjson,"pubsecp")); + bitcoin_address("KMD",coinaddr,0,60,pubkey33,33); + printf("sig failure.(%s) %s\n",jprint(argjson,0),coinaddr); + } return(clonestr("{\"error\":\"sig failure\"}")); } } From 3bbbb7846d0bfb46b291314c207cb8ae7abf8fd6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 14:56:01 +0300 Subject: [PATCH 49/98] Only print one sig error from add --- iguana/exchanges/LP_signatures.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index de3702076..2c45e53ce 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -484,9 +484,14 @@ char *LP_postprice_recv(cJSON *argjson) { if ( jstr(argjson,"pubsecp") != 0 ) { + static char lasterror[64]; decode_hex(pubkey33,33,jstr(argjson,"pubsecp")); bitcoin_address("KMD",coinaddr,0,60,pubkey33,33); - printf("sig failure.(%s) %s\n",jprint(argjson,0),coinaddr); + if ( strcmp(coinaddr,lasterror) != 0 ) + { + printf("sig failure.(%s) %s\n",jprint(argjson,0),coinaddr); + strcpy(lasterror,coinaddr); + } } return(clonestr("{\"error\":\"sig failure\"}")); } From bd576c7b8da36cb9ad94df137760b281956b8712 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Apr 2018 16:27:48 +0300 Subject: [PATCH 50/98] -print --- iguana/dpow/dpow_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 8a10066fe..a0c51b9e4 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1901,7 +1901,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru printf("mypaxcrc.%x\n",bp->paxwdcrc); } char str[65]; - if ( (rand() % 130) == 0 || strcmp(dp->symbol,"KMD") == 0 ) + if ( (rand() % 130) == 0 )//|| strcmp(dp->symbol,"KMD") == 0 ) printf("%p ht.%d [%d] ips.%d %s NOTARIZE.%d matches.%d paxmatches.%d bestmatches.%d bestk.%d %llx recv.%llx sigmasks.(%llx %llx) senderind.%d state.%x (%x %x %x) MoM.%s [%d]\n",bp,bp->height,bp->myind,dp->numipbits,dp->symbol,bp->minsigs,matches,paxmatches,bestmatches,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask,(long long)(bp->bestk>=0?bp->destsigsmasks[bp->bestk]:0),(long long)(bp->bestk>=0?bp->srcsigsmasks[bp->bestk]:0),senderind,bp->state,bp->hashmsg.uints[0],bp->desttxid.uints[0],bp->srctxid.uints[0],bits256_str(str,bp->MoM),bp->MoMdepth); } } From df020ea70f7bd5ad57bd4f565b9ce81704229682 Mon Sep 17 00:00:00 2001 From: "patchkez@gmail.com" Date: Fri, 27 Apr 2018 12:55:08 +0200 Subject: [PATCH 51/98] add beer and pizza addcoin method scripts --- iguana/coins/beer_7776 | 2 ++ iguana/coins/pizza_7776 | 2 ++ 2 files changed, 4 insertions(+) create mode 100755 iguana/coins/beer_7776 create mode 100755 iguana/coins/pizza_7776 diff --git a/iguana/coins/beer_7776 b/iguana/coins/beer_7776 new file mode 100755 index 000000000..7a603f360 --- /dev/null +++ b/iguana/coins/beer_7776 @@ -0,0 +1,2 @@ +#!/bin/bash +curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"BEER.conf\",\"path\":\"${HOME#"/"}/.komodo/BEER\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BEER\",\"name\":\"BEER\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"9fecbb6e\",\"p2p\":8922,\"rpc\":8923,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}" diff --git a/iguana/coins/pizza_7776 b/iguana/coins/pizza_7776 new file mode 100755 index 000000000..baaf702fb --- /dev/null +++ b/iguana/coins/pizza_7776 @@ -0,0 +1,2 @@ +#!/bin/bash +curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"PIZZA.conf\",\"path\":\"${HOME#"/"}/.komodo/PIZZA\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"PIZZA\",\"name\":\"PIZZA\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"adbe523c\",\"p2p\":11607,\"rpc\":11608,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}" From e5d465e6b76f757556c124ffb319aea5349ff07e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Apr 2018 14:14:50 +0300 Subject: [PATCH 52/98] issue_calcMoM --- iguana/dpow/dpow_fsm.c | 156 +++++++++-------------------------------- iguana/dpow/dpow_rpc.c | 15 ++++ iguana/iguana_notary.c | 119 ++++++++++++++++++++++++++++++- 3 files changed, 167 insertions(+), 123 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 048c7197a..228ce1038 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -230,121 +230,7 @@ int32_t dpow_opreturn_parsesrc(bits256 *blockhashp,int32_t *heightp,bits256 *txi return(-1); } -int32_t dpow_txhasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t height,struct komodo_ccdataMoMoM *mdata) -{ - cJSON *txobj,*vins,*vin,*vouts,*vout,*spentobj,*sobj; char *hexstr; uint8_t script[256]; bits256 spenttxid; uint64_t notarymask=0; int32_t i,j,numnotaries,len,spentvout,numvins,numvouts,hasnotarization = 0; - if ( (txobj= dpow_gettransaction(myinfo,coin,txid)) != 0 ) - { - if ( (vins= jarray(&numvins,txobj,"vin")) != 0 ) - { - if ( numvins >= DPOW_MIN_ASSETCHAIN_SIGS ) - { - notarymask = numnotaries = 0; - for (i=0; i>= 1; - decode_hex(script,len,hexstr); - if ( script[0] == 33 && script[34] == 0xac ) - { - for (j=0; j 0 ) - { - if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) - { - hasnotarization = 1; - *nothtp = 0; - if ( (vouts= jarray(&numvouts,txobj,"vout")) != 0 ) - { - bits256 blockhash,txid,MoM; uint32_t MoMdepth; char symbol[65];//,str[65],str2[65],str3[65]; - vout = jitem(vouts,numvouts-1); - if ( (sobj= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(sobj,"hex")) != 0 && (len= is_hexstr(hexstr,0)) > 36*2 && len < sizeof(script)*2 ) - { - len >>= 1; - decode_hex(script,len,hexstr); - if ( dpow_opreturn_parsesrc(&blockhash,nothtp,&txid,symbol,&MoM,&MoMdepth,script,len,mdata) > 0 && strcmp(symbol,coin->symbol) == 0 ) - { - // if ( Notaries_port != DPOW_SOCKPORT ) // keep going till valid MoM found, useful for new chains without any MoM - { - if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 || *nothtp >= height || *nothtp < 0 ) - { - *nothtp = 0; - } - } - if ( mdata->pairs != 0 && mdata->numpairs > 0 ) - { - for (j=0; jnumpairs; j++) - { - if ( mdata->pairs[j].notarization_height > coin->MoMoMheight ) - { - coin->MoMoMheight = mdata->pairs[j].notarization_height; - printf("set %s MoMoMheight <- %d\n",coin->symbol,coin->MoMoMheight); - } - } - } - //printf("%s.%d notarizationht.%d %s -> %s MoM.%s [%d]\n",symbol,height,*nothtp,bits256_str(str,blockhash),bits256_str(str2,txid),bits256_str(str3,MoM),MoMdepth); - } - } - } - } - } - } - } - free_json(txobj); - } - if ( hasnotarization != 0 ) - (*signedmaskp) = notarymask; - return(hasnotarization); -} - -int32_t dpow_hasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supernet_info *myinfo,struct iguana_info *coin,cJSON *blockjson,int32_t ht,struct komodo_ccdataMoMoM *mdata) -{ - int32_t i,n,hasnotarization = 0; bits256 txid; cJSON *txarray; - *nothtp = 0; - *signedmaskp = 0; - memset(mdata,0,sizeof(*mdata)); - if ( (txarray= jarray(&n,blockjson,"tx")) != 0 ) - { - for (i=0; isymbol,height,MoMdepth); return(MoM); +}*/ + +/*{ + "coin": "PIZZA", + "height": 30623, + "MoMdepth": 10000, + "MoM": "797239cfd3611d359ec515fa493062cc2838172a99fd86de1d0305d009abde40" +}*/ + +bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct iguana_info *coin,int32_t height) +{ + bits256 MoM; cJSON *MoMjson,*infojson; int32_t prevMoMheight; + *MoMdepthp = 0; + memset(MoM.bytes,0,sizeof(MoM)); + if ( (infojson= dpow_getinfo(myinfo,coin)) != 0 ) + { + if ( (prevMoMheight= jint(infojson,"prevMoMheight")) != 0 ) + { + *MoMdepthp = (height - prevMoMheight); + if ( *MoMdepthp > 0 && (MoMjson= issue_calcMoM(coin,height,*MoMdepthp)) != 0 ) + { + MoM = jbits256(MoMjson,"MoM"); + free_json(MoMjson); + } + } + free_json(infojson); + } + if ( bits256_nonz(MoM) == 0 ) + *MoMdepthp = 0; + return(MoM); } void dpow_statemachinestart(void *ptr) @@ -439,16 +355,14 @@ void dpow_statemachinestart(void *ptr) return; } MoMdepth = 0; - if ( 0 && strcmp(dp->dest,"KMD") == 0 ) - { - portable_mutex_lock(&src->MoM_mutex); - MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); - portable_mutex_unlock(&src->MoM_mutex); - } else memset(&MoM,0,sizeof(MoM)); + memset(&MoM,0,sizeof(MoM)); if ( strcmp(src->symbol,"KMD") == 0 ) kmdheight = checkpoint.blockhash.height; else if ( strcmp(dest->symbol,"KMD") == 0 ) + { + MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); kmdheight = dest->longestchain; + } if ( (bp= dp->blocks[checkpoint.blockhash.height]) == 0 ) { bp = calloc(1,sizeof(*bp)); diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 2fec9399d..808970aaf 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -226,6 +226,21 @@ bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *c return(blockhash); } +cJSON *issue_calcMoM(struct iguana_info *coin,int32_t height,int32_t MoMdepth) +{ + char buf[128],*retstr=0; cJSON *retjson = 0; + if ( coin->FULLNODE < 0 ) + { + sprintf(buf,"[\"%d\", \"%d\"]",height,MoMdepth); + if ( (retstr= bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"calc_MoM",buf)) != 0 ) + { + retjson = cJSON_Parse(retstr); + printf("MoM.%s -> %s\n",buf,retstr); + free(retstr); + } + } + return(retjson); +} cJSON *dpow_MoMoMdata(struct iguana_info *coin,char *symbol,int32_t kmdheight) { diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index ecaa0b084..142c71619 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -76,7 +76,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he else freq = 1; } dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); - if ( strcmp(dp->dest,"KMD") == 0 )//|| strcmp(dp->dest,"CHAIN") == 0 ) + /*if ( strcmp(dp->dest,"KMD") == 0 )//|| strcmp(dp->dest,"CHAIN") == 0 ) { //if ( dp->SRCREALTIME == 0 ) // return; @@ -117,7 +117,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he } else return; } else return; } else return; - } + }*/ if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) { if ( (0) && strcmp("KMD",dp->symbol) == 0 ) @@ -579,6 +579,121 @@ void iguana_notarystats(int32_t totals[64],int32_t dispflag) } } +// slow and should be redone to use calc_MoM rpc +int32_t dpow_txhasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t height,struct komodo_ccdataMoMoM *mdata) +{ + cJSON *txobj,*vins,*vin,*vouts,*vout,*spentobj,*sobj; char *hexstr; uint8_t script[256]; bits256 spenttxid; uint64_t notarymask=0; int32_t i,j,numnotaries,len,spentvout,numvins,numvouts,hasnotarization = 0; + if ( (txobj= dpow_gettransaction(myinfo,coin,txid)) != 0 ) + { + if ( (vins= jarray(&numvins,txobj,"vin")) != 0 ) + { + if ( numvins >= DPOW_MIN_ASSETCHAIN_SIGS ) + { + notarymask = numnotaries = 0; + for (i=0; i>= 1; + decode_hex(script,len,hexstr); + if ( script[0] == 33 && script[34] == 0xac ) + { + for (j=0; j 0 ) + { + if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) + { + hasnotarization = 1; + *nothtp = 0; + if ( (vouts= jarray(&numvouts,txobj,"vout")) != 0 ) + { + bits256 blockhash,txid,MoM; uint32_t MoMdepth; char symbol[65];//,str[65],str2[65],str3[65]; + vout = jitem(vouts,numvouts-1); + if ( (sobj= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(sobj,"hex")) != 0 && (len= is_hexstr(hexstr,0)) > 36*2 && len < sizeof(script)*2 ) + { + len >>= 1; + decode_hex(script,len,hexstr); + if ( dpow_opreturn_parsesrc(&blockhash,nothtp,&txid,symbol,&MoM,&MoMdepth,script,len,mdata) > 0 && strcmp(symbol,coin->symbol) == 0 ) + { + // if ( Notaries_port != DPOW_SOCKPORT ) // keep going till valid MoM found, useful for new chains without any MoM + { + if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 || *nothtp >= height || *nothtp < 0 ) + { + *nothtp = 0; + } + } + if ( mdata->pairs != 0 && mdata->numpairs > 0 ) + { + for (j=0; jnumpairs; j++) + { + if ( mdata->pairs[j].notarization_height > coin->MoMoMheight ) + { + coin->MoMoMheight = mdata->pairs[j].notarization_height; + printf("set %s MoMoMheight <- %d\n",coin->symbol,coin->MoMoMheight); + } + } + } + //printf("%s.%d notarizationht.%d %s -> %s MoM.%s [%d]\n",symbol,height,*nothtp,bits256_str(str,blockhash),bits256_str(str2,txid),bits256_str(str3,MoM),MoMdepth); + } + } + } + } + } + } + } + free_json(txobj); + } + if ( hasnotarization != 0 ) + (*signedmaskp) = notarymask; + return(hasnotarization); +} + +int32_t dpow_hasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supernet_info *myinfo,struct iguana_info *coin,cJSON *blockjson,int32_t ht,struct komodo_ccdataMoMoM *mdata) +{ + int32_t i,n,hasnotarization = 0; bits256 txid; cJSON *txarray; + *nothtp = 0; + *signedmaskp = 0; + memset(mdata,0,sizeof(*mdata)); + if ( (txarray= jarray(&n,blockjson,"tx")) != 0 ) + { + for (i=0; i Date: Fri, 27 Apr 2018 14:34:20 +0300 Subject: [PATCH 53/98] Merge --- iguana/dpow/dpow_fsm.c | 193 ----------------------------------------- 1 file changed, 193 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index ce0cd186e..03fc81544 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -230,199 +230,6 @@ int32_t dpow_opreturn_parsesrc(bits256 *blockhashp,int32_t *heightp,bits256 *txi return(-1); } -<<<<<<< HEAD -/*bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct iguana_info *coin,int32_t height) -======= -int32_t dpow_txhasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t height,struct komodo_ccdataMoMoM *mdata) -{ - cJSON *txobj,*vins,*vin,*vouts,*vout,*spentobj,*sobj; char *hexstr; uint8_t script[256]; bits256 spenttxid; uint64_t notarymask=0; int32_t i,j,numnotaries,len,spentvout,numvins,numvouts,hasnotarization = 0; - if ( (txobj= dpow_gettransaction(myinfo,coin,txid)) != 0 ) - { - if ( (vins= jarray(&numvins,txobj,"vin")) != 0 ) - { - if ( numvins >= DPOW_MIN_ASSETCHAIN_SIGS ) - { - notarymask = numnotaries = 0; - for (i=0; i>= 1; - decode_hex(script,len,hexstr); - if ( script[0] == 33 && script[34] == 0xac ) - { - for (j=0; j 0 ) - { - if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) - { - hasnotarization = 1; - *nothtp = 0; - if ( (vouts= jarray(&numvouts,txobj,"vout")) != 0 ) - { - bits256 blockhash,txid,MoM; uint32_t MoMdepth; char symbol[65];//,str[65],str2[65],str3[65]; - vout = jitem(vouts,numvouts-1); - if ( (sobj= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(sobj,"hex")) != 0 && (len= is_hexstr(hexstr,0)) > 36*2 && len < sizeof(script)*2 ) - { - len >>= 1; - decode_hex(script,len,hexstr); - if ( dpow_opreturn_parsesrc(&blockhash,nothtp,&txid,symbol,&MoM,&MoMdepth,script,len,mdata) > 0 && strcmp(symbol,coin->symbol) == 0 ) - { - //if ( Notaries_port != DPOW_SOCKPORT ) // keep going till valid MoM found, useful for new chains without any MoM - { - if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 || *nothtp >= height || *nothtp < 0 ) - { - *nothtp = 0; - } - } - if ( mdata->pairs != 0 && mdata->numpairs > 0 ) - { - for (j=0; jnumpairs; j++) - { - if ( mdata->pairs[j].notarization_height > coin->MoMoMheight ) - { - coin->MoMoMheight = mdata->pairs[j].notarization_height; - printf("set %s MoMoMheight <- %d\n",coin->symbol,coin->MoMoMheight); - } - } - } - //printf("%s.%d notarizationht.%d %s -> %s MoM.%s [%d]\n",symbol,height,*nothtp,bits256_str(str,blockhash),bits256_str(str2,txid),bits256_str(str3,MoM),MoMdepth); - } - } - } - } - } - } - } - free_json(txobj); - } - if ( hasnotarization != 0 ) - (*signedmaskp) = notarymask; - return(hasnotarization); -} - -int32_t dpow_hasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supernet_info *myinfo,struct iguana_info *coin,cJSON *blockjson,int32_t ht,struct komodo_ccdataMoMoM *mdata) -{ - int32_t i,n,hasnotarization = 0; bits256 txid; cJSON *txarray; - *nothtp = 0; - *signedmaskp = 0; - memset(mdata,0,sizeof(*mdata)); - if ( (txarray= jarray(&n,blockjson,"tx")) != 0 ) - { - for (i=0; i>>>>>> dev -{ - struct komodo_ccdataMoMoM mdata; bits256 MoM,blockhash,merkle,*merkles; cJSON *blockjson; uint64_t signedmask; int32_t breakht=0,notht=0,ht,maxdepth = DPOW_MAXMOMDEPTH,MoMdepth = 0; - memset(MoM.bytes,0,sizeof(MoM)); - blockhash = dpow_getblockhash(myinfo,coin,height); - //printf("start MoM calc %s height.%d\n",coin->symbol,height); - if ( (blockjson= dpow_getblock(myinfo,coin,blockhash)) != 0 ) - { - merkle = jbits256(blockjson,"merkleroot"); - free_json(blockjson); - if ( bits256_nonz(merkle) != 0 ) - { - merkles = calloc(4*maxdepth+1,sizeof(*merkles)); - merkles[MoMdepth++] = merkle; - ht = height - MoMdepth; - while ( MoMdepth < maxdepth && ht > breakht && ht > 0 ) - { - //fprintf(stderr,"%s.%d ",coin->symbol,ht); - blockhash = dpow_getblockhash(myinfo,coin,ht); - if ( (blockjson= dpow_getblock(myinfo,coin,blockhash)) != 0 ) - { - if ( breakht == 0 && dpow_hasnotarization(&signedmask,¬ht,myinfo,coin,blockjson,ht,&mdata) > 0 ) - { - breakht = notht; - printf("%s has notarization at %d for breakht.%d\n",coin->symbol,ht,notht); - } - merkle = jbits256(blockjson,"merkleroot"); - free_json(blockjson); - if ( bits256_nonz(merkle) != 0 ) - merkles[MoMdepth++] = merkle; - else - { - printf("%s MoMdepth.%d ht.%d from height.%d, null merkleroot\n",coin->symbol,MoMdepth,ht,height); - MoMdepth = 0; - if ( mdata.pairs != 0 ) - free(mdata.pairs); - break; - } - } - else - { - printf("%s MoMdepth.%d ht.%d from height.%d, no blockhash\n",coin->symbol,MoMdepth,ht,height); - MoMdepth = 0; - if ( mdata.pairs != 0 ) - free(mdata.pairs); - break; - } - ht = height - MoMdepth; - usleep(10000); - } - if ( MoMdepth > 0 ) - { - MoM = iguana_merkle(coin->symbol,merkles,MoMdepth); - char str[65]; printf("%s from height.%d ht.%d MoMdepth.%d -> MoM %s\n",coin->symbol,height,ht,MoMdepth,bits256_str(str,MoM)); - } - else - { - printf("unexpected %s from height.%d MoMdepth.%d vs max.%d\n",coin->symbol,height,MoMdepth,maxdepth); - MoMdepth = 0; - } - free(merkles); - } else printf("%s.ht%d null merkles\n",coin->symbol,height); - } else printf("%s.ht%d null block\n",coin->symbol,height); - *MoMdepthp = MoMdepth; - //printf("done MoM calc %s height.%d MoMdepth.%d\n",coin->symbol,height,MoMdepth); - return(MoM); -}*/ - -/*{ - "coin": "PIZZA", - "height": 30623, - "MoMdepth": 10000, - "MoM": "797239cfd3611d359ec515fa493062cc2838172a99fd86de1d0305d009abde40" -}*/ - bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct iguana_info *coin,int32_t height) { bits256 MoM; cJSON *MoMjson,*infojson; int32_t prevMoMheight; From fe71d39850f86f4d6b90e1429d92a54b538b8b87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Apr 2018 14:47:57 +0300 Subject: [PATCH 54/98] +MoM print --- iguana/dpow/dpow_fsm.c | 2 +- iguana/iguana_notary.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 03fc81544..844a9583c 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -427,7 +427,7 @@ void dpow_statemachinestart(void *ptr) return; } bp->myind = myind; - printf("[%d] notarize %s->%s %s ht.%d minsigs.%d duration.%d start.%u\n",bp->myind,dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height,minsigs,duration,checkpoint.timestamp); + printf("[%d] notarize %s->%s %s ht.%d minsigs.%d duration.%d start.%u MoM[%d] %s\n",bp->myind,dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height,minsigs,duration,checkpoint.timestamp,bp->MoMdepth,bits256_str(str2,bp->MoM)); if ( bp->isratify != 0 && memcmp(bp->notaries[0].pubkey,bp->ratified_pubkeys[0],33) != 0 ) { for (i=0; i<33; i++) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 142c71619..d614de1b9 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -60,7 +60,8 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime) { - struct komodo_ccdataMoMoM mdata; void **ptrs; char str[65]; cJSON *blockjson; struct iguana_info *coin; struct dpow_checkpoint checkpoint; int32_t freq,minsigs,i,ht,notht; uint64_t signedmask; struct dpow_block *bp; + //struct komodo_ccdataMoMoM mdata; cJSON *blockjson; uint64_t signedmask; struct iguana_info *coin; + void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t freq,minsigs,i,ht; struct dpow_block *bp; dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); checkpoint = dp->srcfifo[dp->srcconfirms]; if ( strcmp("BTC",dp->dest) == 0 ) From 5c3c3193e4f8aa365c265c033862d9821d3c81ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Apr 2018 14:48:42 +0300 Subject: [PATCH 55/98] -print --- iguana/dpow/dpow_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 808970aaf..c9f47ce4d 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -235,7 +235,7 @@ cJSON *issue_calcMoM(struct iguana_info *coin,int32_t height,int32_t MoMdepth) if ( (retstr= bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"calc_MoM",buf)) != 0 ) { retjson = cJSON_Parse(retstr); - printf("MoM.%s -> %s\n",buf,retstr); + //printf("MoM.%s -> %s\n",buf,retstr); free(retstr); } } From 66f1d11753d30734be98ced092ea16b3d6bf1d51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Apr 2018 15:13:20 +0300 Subject: [PATCH 56/98] Handle initial MoM --- iguana/dpow/dpow_fsm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 844a9583c..b66bddcd0 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -237,9 +237,13 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu memset(MoM.bytes,0,sizeof(MoM)); if ( (infojson= dpow_getinfo(myinfo,coin)) != 0 ) { - if ( (prevMoMheight= jint(infojson,"prevMoMheight")) != 0 ) + if ( (prevMoMheight= jint(infojson,"prevMoMheight")) >= 0 ) { + if ( prevMoMheight == 0 ) + prevMoMheight = 1; *MoMdepthp = (height - prevMoMheight); + if ( *MoMdepthp > 1440*30 ) + *MoMdepthp = 1440*30; if ( *MoMdepthp > 0 && (MoMjson= issue_calcMoM(coin,height,*MoMdepthp)) != 0 ) { MoM = jbits256(MoMjson,"MoM"); From 77b1892a5cb516eb3bbc776805e38dc7014f95b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Apr 2018 19:23:08 +0300 Subject: [PATCH 57/98] Allow wif for iguana passphrase --- iguana/SuperNET_keys.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/iguana/SuperNET_keys.c b/iguana/SuperNET_keys.c index 63c169b89..fe116ddc6 100755 --- a/iguana/SuperNET_keys.c +++ b/iguana/SuperNET_keys.c @@ -310,13 +310,22 @@ int32_t _SuperNET_encryptjson(struct supernet_info *myinfo,char *destfname,char return(0); } +int32_t LP_wifstr_valid(char *symbol,char *wifstr); +int32_t curve25519_donna(uint8_t *mypublic,const uint8_t *secret,const uint8_t *basepoint); + void SuperNET_setkeys(struct supernet_info *myinfo,void *pass,int32_t passlen,int32_t dosha256) { - bits256 hash; + static uint8_t basepoint[32] = {9}; bits256 hash; uint8_t addrtype,usedwif = 0; if ( dosha256 != 0 ) { memcpy(myinfo->secret,pass,passlen+1); - myinfo->myaddr.nxt64bits = conv_NXTpassword(myinfo->persistent_priv.bytes,myinfo->myaddr.persistent.bytes,pass,passlen); + if ( LP_wifstr_valid("KMD",pass) > 0 ) + { + usedwif = 1; + bitcoin_wif2priv(&addrtype,&myinfo->persistent_priv,(char *)pass); + curve25519_donna(myinfo->myaddr.persistent.bytes,myinfo->persistent_priv.bytes,basepoint); + } + else myinfo->myaddr.nxt64bits = conv_NXTpassword(myinfo->persistent_priv.bytes,myinfo->myaddr.persistent.bytes,pass,passlen); } else { @@ -329,6 +338,8 @@ void SuperNET_setkeys(struct supernet_info *myinfo,void *pass,int32_t passlen,in bitcoin_pubkey33(myinfo->ctx,myinfo->persistent_pubkey33,myinfo->persistent_priv); bitcoin_address(myinfo->myaddr.BTC,0,myinfo->persistent_pubkey33,33); bitcoin_address(myinfo->myaddr.BTCD,60,myinfo->persistent_pubkey33,33); + if ( usedwif != 0 ) + printf("usedwif for %s %s\n",myinfo->myaddr.BTCD,myinfo->myaddr.BTC); } void SuperNET_parsemyinfo(struct supernet_info *myinfo,cJSON *msgjson) From f31f75559bb43f3ea3c2e3e6bd24e4130693a381 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Apr 2018 19:35:11 +0300 Subject: [PATCH 58/98] Fix --- iguana/SuperNET_keys.c | 52 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/iguana/SuperNET_keys.c b/iguana/SuperNET_keys.c index fe116ddc6..1528ad8fc 100755 --- a/iguana/SuperNET_keys.c +++ b/iguana/SuperNET_keys.c @@ -310,16 +310,64 @@ int32_t _SuperNET_encryptjson(struct supernet_info *myinfo,char *destfname,char return(0); } -int32_t LP_wifstr_valid(char *symbol,char *wifstr); int32_t curve25519_donna(uint8_t *mypublic,const uint8_t *secret,const uint8_t *basepoint); +static const char base58_chars[] = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; + +int32_t iguana_wifstr_valid(char *wifstr) +{ + bits256 privkey,cmpkey; uint8_t wiftype; char cmpstr[128],cmpstr2[128]; int32_t i,len,n,a,A; + if ( (len= (int32_t)strlen(wifstr)) < 50 || len > 54 ) + { + //printf("len.%d is wrong for wif %s\n",len,wifstr); + return(0); + } + memset(privkey.bytes,0,sizeof(privkey)); + memset(cmpkey.bytes,0,sizeof(cmpkey)); + for (i=n=a=A=0; wifstr[i]!=0; i++) + { + if ( strchr(base58_chars,wifstr[i]) == 0 ) + return(0); + if ( wifstr[i] >= '1' && wifstr[i] <= '9' ) + n++; + else if ( wifstr[i] >= 'A' && wifstr[i] <= 'Z' ) + A++; + else if ( wifstr[i] >= 'a' && wifstr[i] <= 'z' ) + a++; + } + if ( n == 0 || A == 0 || a == 0 ) + return(0); + if ( A > 5*a || a > 5*A || a > n*20 || A > n*20 ) // unlikely it is a real wif + { + printf("reject wif %s due to n.%d a.%d A.%d (%d %d %d %d)\n",wifstr,n,a,A,A > 5*a,a < 5*A,a > n*20,A > n*20); + return(0); + } + bitcoin_wif2priv(&wiftype,&privkey,wifstr); + bitcoin_priv2wif(cmpstr,privkey,wiftype); + if ( strcmp(cmpstr,wifstr) == 0 ) + { + //printf("%s is valid wif\n",wifstr); + return(1); + } + else if ( bits256_nonz(privkey) != 0 ) + { + bitcoin_wif2priv(&wiftype,&cmpkey,cmpstr); + bitcoin_priv2wiflong(cmpstr2,privkey,wiftype); + if ( bits256_cmp(privkey,cmpkey) == 0 ) + return(1); + char str[65],str2[65]; printf("mismatched wifstr %s -> %s -> %s %s %s\n",wifstr,bits256_str(str,privkey),cmpstr,bits256_str(str2,cmpkey),cmpstr2); + } + char str[65]; printf("%s is not a wif, privkey.%s\n",wifstr,bits256_str(str,privkey)); + return(0); +} + void SuperNET_setkeys(struct supernet_info *myinfo,void *pass,int32_t passlen,int32_t dosha256) { static uint8_t basepoint[32] = {9}; bits256 hash; uint8_t addrtype,usedwif = 0; if ( dosha256 != 0 ) { memcpy(myinfo->secret,pass,passlen+1); - if ( LP_wifstr_valid("KMD",pass) > 0 ) + if ( iguana_wifstr_valid((char *)pass) > 0 ) { usedwif = 1; bitcoin_wif2priv(&addrtype,&myinfo->persistent_priv,(char *)pass); From 24058a5f58a5c454b5b611f0109cd7b3dfea9010 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Apr 2018 19:37:15 +0300 Subject: [PATCH 59/98] -print --- iguana/SuperNET_keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/SuperNET_keys.c b/iguana/SuperNET_keys.c index 1528ad8fc..e3aa24935 100755 --- a/iguana/SuperNET_keys.c +++ b/iguana/SuperNET_keys.c @@ -386,7 +386,7 @@ void SuperNET_setkeys(struct supernet_info *myinfo,void *pass,int32_t passlen,in bitcoin_pubkey33(myinfo->ctx,myinfo->persistent_pubkey33,myinfo->persistent_priv); bitcoin_address(myinfo->myaddr.BTC,0,myinfo->persistent_pubkey33,33); bitcoin_address(myinfo->myaddr.BTCD,60,myinfo->persistent_pubkey33,33); - if ( usedwif != 0 ) + if ( (0) && usedwif != 0 ) printf("usedwif for %s %s\n",myinfo->myaddr.BTCD,myinfo->myaddr.BTC); } From 727d48548edc63c9972598521f7450aa7891c9f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Apr 2018 12:50:40 +0300 Subject: [PATCH 60/98] Scaling fixes for iguana notary --- deprecated/iguana_notary.c | 1279 +++++++++++++++++++++++++++++++++ iguana/dpow/dPoW.h | 3 +- iguana/iguana777.h | 2 +- iguana/iguana_notary.c | 51 +- includes/iguana_apideclares.h | 2 +- 5 files changed, 1320 insertions(+), 17 deletions(-) create mode 100755 deprecated/iguana_notary.c diff --git a/deprecated/iguana_notary.c b/deprecated/iguana_notary.c new file mode 100755 index 000000000..420166fba --- /dev/null +++ b/deprecated/iguana_notary.c @@ -0,0 +1,1279 @@ +/****************************************************************************** + * Copyright © 2014-2018 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + + +// Todo list: +// q) investigate if rebroadcast reorged local chain notary tx and scanning mempool is needed + +#define CHECKSIG 0xac + +#include "iguana777.h" +//#include "notaries.h" + +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); +uint64_t dpow_maskmin(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp); +int32_t dpow_checkutxo(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,struct iguana_info *coin,bits256 *txidp,int32_t *voutp,char *coinaddr,char *srccoin); + +#include "dpow/dpow_network.c" +#include "dpow/dpow_rpc.c" +#include "dpow/dpow_tx.c" +#include "dpow/dpow_fsm.c" +#include "dpow/dpow_prices.c" + +void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,struct dpow_checkpoint tip) +{ + int32_t i,ind; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE]; + 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 ) + printf("(%d != %d) ",(tip.blockhash.height - fifo[i-1].blockhash.height),i); + if ( (ind= (tip.blockhash.height - fifo[i-1].blockhash.height)) >= 0 && ind < DPOW_FIFOSIZE ) + newfifo[ind] = fifo[i-1]; + } + newfifo[0] = tip; + memcpy(fifo,newfifo,sizeof(newfifo)); + //for (i=0; itimestamp = timestamp; + checkpoint->blocktime = blocktime; + checkpoint->blockhash.hash = hash; + checkpoint->blockhash.height = height; +} + +void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime) +{ + //struct komodo_ccdataMoMoM mdata; cJSON *blockjson; uint64_t signedmask; struct iguana_info *coin; + void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t freq,minsigs,i,ht; struct dpow_block *bp; + dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); + checkpoint = dp->srcfifo[dp->srcconfirms]; + if ( strcmp("BTC",dp->dest) == 0 ) + { + freq = DPOW_CHECKPOINTFREQ; + minsigs = Notaries_BTCminsigs; //DPOW_MINSIGS; + } + else + { + minsigs = Notaries_minsigs; //DPOW_MIN_ASSETCHAIN_SIGS; + if ( strcmp("CHIPS",dp->symbol) == 0 ) + freq = 100; + else freq = 1; + } + dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); + /*if ( strcmp(dp->dest,"KMD") == 0 )//|| strcmp(dp->dest,"CHAIN") == 0 ) + { + //if ( dp->SRCREALTIME == 0 ) + // return; + if ( (coin= iguana_coinfind(dp->symbol)) != 0 ) + { + hash = dpow_getbestblockhash(myinfo,coin); + if ( bits256_nonz(hash) != 0 ) + { + if ( (blockjson= dpow_getblock(myinfo,coin,hash)) != 0 ) + { + height = jint(blockjson,"height"); + if ( dpow_hasnotarization(&signedmask,¬ht,myinfo,coin,blockjson,height,&mdata) <= 0 ) + { + if ( mdata.pairs != 0 ) + free(mdata.pairs); + blocktime = juint(blockjson,"time"); + free_json(blockjson); + if ( height > 0 && blocktime > 0 ) + { + dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) + printf("dynamic set %s/%s %s <- height.%d\n",dp->symbol,dp->dest,bits256_str(str,hash),height); + checkpoint = dp->last; + } else return; + if ( bits256_nonz(dp->activehash) != 0 && bits256_cmp(dp->activehash,checkpoint.blockhash.hash) == 0 ) + { + printf("activehash.(%s) is current checkpoint, skip\n",bits256_str(str,dp->activehash)); + return; + } + else if ( bits256_nonz(dp->lastnotarized) != 0 && bits256_cmp(dp->lastnotarized,checkpoint.blockhash.hash) == 0 ) + { + printf("lastnotarized.(%s) is current checkpoint, skip\n",bits256_str(str,dp->lastnotarized)); + return; + } + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) + printf("checkpoint.(%s) is not active and not lastnotarized\n",bits256_str(str,checkpoint.blockhash.hash)); + } else return; + } else return; + } else return; + } else return; + }*/ + if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) + { + if ( (0) && strcmp("KMD",dp->symbol) == 0 ) + printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); + dpow_heightfind(myinfo,dp,checkpoint.blockhash.height + 1000); + ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint) + sizeof(pthread_t)); + ptrs[0] = (void *)myinfo; + ptrs[1] = (void *)dp; + ptrs[2] = (void *)(uint64_t)minsigs; + if ( strcmp(dp->dest,"KMD") != 0 ) + ptrs[3] = (void *)DPOW_DURATION; + else ptrs[3] = (void *)(DPOW_DURATION * 60); // essentially try forever for assetchains + ptrs[4] = 0; + memcpy(&ptrs[5],&checkpoint,sizeof(checkpoint)); + dp->activehash = checkpoint.blockhash.hash; + ht = checkpoint.blockhash.height; + if ( OS_thread_create((void *)((uint64_t)&ptrs[5] + sizeof(struct dpow_checkpoint)),NULL,(void *)dpow_statemachinestart,(void *)ptrs) != 0 ) + { + } + if ( ht > 500 ) + { + if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) + printf("ht.%d maxblocks.%d\n",ht,dp->maxblocks); + for (i=ht-500; i>ht-10000&&i>100; i--) + { + if ( (i % 100) != 0 && (bp= dp->blocks[i]) != 0 && bp->state == 0xffffffff ) + { + dp->blocks[i] = 0; + Numallocated--; + free(bp); + } + } + } + } +} + +void dpow_approvedset(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_checkpoint *checkpoint,bits256 *txs,int32_t numtx) +{ + int32_t i,j; bits256 txid; + if ( txs != 0 ) + { + for (i=0; iapproved[j].hash) == 0 ) + { + if ( bits256_nonz(checkpoint->approved.hash) == 0 || dp->approved[j].height >= checkpoint->approved.height ) + checkpoint->approved = dp->approved[j]; + } + } + } + } + } +} + +void dpow_destconfirm(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_checkpoint *checkpoint) +{ + int32_t i; + if ( bits256_nonz(checkpoint->approved.hash) != 0 ) + { + for (i=DPOW_FIFOSIZE-1; i>0; i--) + dp->notarized[i] = dp->notarized[i-1]; + dp->notarized[0] = checkpoint->approved; + } +} + +void dpow_destupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime) +{ + dp->destupdated = timestamp; + dpow_checkpointset(myinfo,&dp->destchaintip,height,hash,timestamp,blocktime); + dpow_approvedset(myinfo,dp,&dp->destchaintip,dp->desttx,dp->numdesttx); + dpow_fifoupdate(myinfo,dp->destfifo,dp->destchaintip); + if ( strcmp(dp->dest,"BTC") == 0 ) + { + //printf("%s destupdate ht.%d\n",dp->dest,height); + dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_BTCCONFIRMS]); + } + else dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_KOMODOCONFIRMS*2]); // todo: change to notarized KMD depth +} + +void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) +{ + int32_t height,num; uint32_t blocktime; bits256 blockhash,merkleroot; struct iguana_info *src,*dest; + //if ( strcmp(dp->symbol,"KMD") == 0 ) + { + num = dpow_nanomsg_update(myinfo); + //fprintf(stderr,"nano.%d ",num); + } + src = iguana_coinfind(dp->symbol); + dest = iguana_coinfind(dp->dest); + if ( src != 0 && dest != 0 ) + { + //fprintf(stderr,"dp.%p dPoWupdate (%s -> %s)\n",dp,dp!=0?dp->symbol:"",dp!=0?dp->dest:""); + dp->numdesttx = sizeof(dp->desttx)/sizeof(*dp->desttx); + if ( (height= dpow_getchaintip(myinfo,&merkleroot,&blockhash,&blocktime,dp->desttx,&dp->numdesttx,dest)) != dp->destchaintip.blockhash.height && height >= 0 ) + { + char str[65]; + if ( (0) && strcmp(dp->symbol,"KMD") == 0 )//|| height != dp->destchaintip.blockhash.height+1 ) + printf("[%s].%d %s %s height.%d vs last.%d\n",dp->symbol,dp->SRCHEIGHT,dp->dest,bits256_str(str,blockhash),height,dp->destchaintip.blockhash.height); + if ( height <= dp->destchaintip.blockhash.height ) + { + printf("iguana_dPoWupdate dest.%s reorg detected %d vs %d\n",dp->dest,height,dp->destchaintip.blockhash.height); + if ( height == dp->destchaintip.blockhash.height && bits256_cmp(blockhash,dp->destchaintip.blockhash.hash) != 0 ) + printf("UNEXPECTED ILLEGAL BLOCK in dest chaintip\n"); + } else dpow_destupdate(myinfo,dp,height,blockhash,(uint32_t)time(NULL),blocktime); + } // else printf("error getchaintip for %s\n",dp->dest); + dp->numsrctx = sizeof(dp->srctx)/sizeof(*dp->srctx); + if ( (strcmp(dp->dest,"KMD") == 0 || strcmp(dp->dest,"CHAIN") == 0) && dp->SRCHEIGHT < src->longestchain ) + { + //fprintf(stderr,"[I "); + dp->SRCHEIGHT = dpow_issuer_iteration(dp,src,dp->SRCHEIGHT,&dp->SRCREALTIME); + //fprintf(stderr," %d] ",dp->SRCHEIGHT); + } + if ( (height= dpow_getchaintip(myinfo,&merkleroot,&blockhash,&blocktime,dp->srctx,&dp->numsrctx,src)) != dp->last.blockhash.height && height >= 0 ) + { + //char str[65]; printf("[%s].%d %s %s height.%d vs last.%d\n",dp->dest,dp->SRCHEIGHT,dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height); + if ( dp->lastheight == 0 ) + dp->lastheight = height-1; + if ( height < dp->last.blockhash.height ) + { + printf("iguana_dPoWupdate src.%s reorg detected %d vs %d approved.%d notarized.%d\n",dp->symbol,height,dp->last.blockhash.height,dp->approved[0].height,dp->notarized[0].height); + if ( height <= dp->approved[0].height ) + { + if ( bits256_cmp(blockhash,dp->last.blockhash.hash) != 0 ) + printf("UNEXPECTED ILLEGAL BLOCK in src chaintip\n"); + } + else + { + while ( dp->lastheight <= height ) + { + blockhash = dpow_getblockhash(myinfo,src,dp->lastheight); + dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime); + } + } + } + else if ( strcmp(dp->symbol,"KMD") == 0 ) + { + while ( dp->lastheight <= height ) + { + blockhash = dpow_getblockhash(myinfo,src,dp->lastheight); + dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime); + } + } + else if ( time(NULL) > dp->lastsrcupdate+60 || height != dp->lastheight ) + { + dp->lastsrcupdate = (uint32_t)time(NULL); + dp->lastheight = height; + blockhash = dpow_getblockhash(myinfo,src,dp->lastheight); + dpow_srcupdate(myinfo,dp,dp->lastheight,blockhash,(uint32_t)time(NULL),blocktime); + } + } //else printf("error getchaintip for %s\n",dp->symbol); + } else printf("iguana_dPoWupdate missing src.(%s) %p or dest.(%s) %p\n",dp->symbol,src,dp->dest,dest); +} + +void dpow_addresses() +{ + int32_t i; char coinaddr[64]; uint8_t pubkey[33]; + for (i=0; iDPOWS[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 ) + { + printf("addrelay.(%s)\n",retstr); + free(retstr); + } + if ( myinfo->NOTARY.RELAYID < 0 ) + return(clonestr("{\"error\":\"must be running as notary node\"}")); + } + if ( dp->symbol[0] != 0 ) + return(clonestr("{\"error\":\"cant dPoW more than one coin at a time\"}")); + if ( pubkey == 0 || pubkey[0] == 0 || is_hexstr(pubkey,0) != 66 ) + return(clonestr("{\"error\":\"need 33 byte pubkey\"}")); + if ( symbol == 0 || symbol[0] == 0 ) + symbol = "KMD"; + if ( dest == 0 || dest[0] == 0 ) + { + if ( strcmp(symbol,"KMD") == 0 ) + dest = "BTC"; + else dest = "KMD"; + } + //if ( myinfo->numdpows == 1 ) + // komodo_assetcoins(-1); + if ( iguana_coinfind(symbol) == 0 ) + return(clonestr("{\"error\":\"cant dPoW an inactive coin\"}")); + if ( strcmp(symbol,"KMD") == 0 && iguana_coinfind("BTC") == 0 ) + return(clonestr("{\"error\":\"cant dPoW KMD without BTC\"}")); + else if ( iguana_coinfind(dest) == 0 ) + return(clonestr("{\"error\":\"cant dPoW without KMD (dest)\"}")); + if ( myinfo->numdpows > 1 ) + { + for (i=1; inumdpows; i++) + if ( strcmp(symbol,myinfo->DPOWS[i].symbol) == 0 ) + { + dp->symbol[0] = 0; + return(clonestr("{\"error\":\"cant dPoW same coin again\"}")); + } + } + strcpy(dp->symbol,symbol); + if ( strcmp(dp->symbol,"KMD") == 0 ) + { + strcpy(dp->dest,"BTC"); + dp->srcconfirms = DPOW_KOMODOCONFIRMS; + } + else + { + strcpy(dp->dest,dest); + dp->srcconfirms = DPOW_THIRDPARTY_CONFIRMS; + } + if ( dp->srcconfirms > DPOW_FIFOSIZE ) + dp->srcconfirms = DPOW_FIFOSIZE; + if ( strcmp("BTC",dp->dest) == 0 ) + { + dp->freq = DPOW_CHECKPOINTFREQ; + dp->minsigs = Notaries_BTCminsigs; //DPOW_MINSIGS; + } + else + { + dp->minsigs = Notaries_minsigs; //DPOW_MIN_ASSETCHAIN_SIGS; + if ( strcmp("CHIPS",dp->symbol) == 0 || strncmp("TEST",dp->symbol,4) == 0) + dp->freq = DPOW_MAXFREQ; + else dp->freq = 1; + } + src = iguana_coinfind(dp->symbol); + destcoin = iguana_coinfind(dp->dest); + if ( src == 0 || destcoin == 0 ) + { + dp->symbol[0] = 0; + return(clonestr("{\"error\":\"source coin or dest coin not there\"}")); + } + char tmp[67]; + safecopy(tmp,pubkey,sizeof(tmp)); + decode_hex(dp->minerkey33,33,tmp); + bitcoin_address(srcaddr,src->chain->pubtype,dp->minerkey33,33); + if ( (retstr= dpow_validateaddress(myinfo,src,srcaddr)) != 0 ) + { + json = cJSON_Parse(retstr); + if ( (ismine= jobj(json,"ismine")) != 0 && is_cJSON_True(ismine) != 0 ) + srcvalid = 1; + else srcvalid = 0; + free(retstr); + retstr = 0; + } + bitcoin_address(destaddr,destcoin->chain->pubtype,dp->minerkey33,33); + if ( (retstr= dpow_validateaddress(myinfo,destcoin,destaddr)) != 0 ) + { + json = cJSON_Parse(retstr); + if ( (ismine= jobj(json,"ismine")) != 0 && is_cJSON_True(ismine) != 0 ) + destvalid = 1; + else destvalid = 0; + free(retstr); + retstr = 0; + } + for (i=0; i<33; i++) + printf("%02x",dp->minerkey33[i]); + printf(" DPOW with pubkey.(%s) %s.valid%d %s -> %s %s.valid%d\n",tmp,srcaddr,srcvalid,dp->symbol,dp->dest,destaddr,destvalid); + if ( srcvalid <= 0 || destvalid <= 0 ) + { + dp->symbol[0] = 0; + return(clonestr("{\"error\":\"source address or dest address has no privkey, importprivkey\"}")); + } + if ( bitcoin_pubkeylen(dp->minerkey33) <= 0 ) + { + dp->symbol[0] = 0; + return(clonestr("{\"error\":\"illegal pubkey\"}")); + } + if ( dp->blocks == 0 ) + { + dp->maxblocks = 10000; + dp->blocks = calloc(dp->maxblocks,sizeof(*dp->blocks)); + } + portable_mutex_init(&dp->paxmutex); + portable_mutex_init(&dp->dexmutex); + PAX_init(); + //printf(">>>>>>>>>>>>>>> call paxpending\n"); + //uint8_t buf[32768]; + //dpow_paxpending(buf); + myinfo->numdpows++; + return(clonestr("{\"result\":\"success\"}")); +} + +char *dpow_passthru(struct iguana_info *coin,char *function,char *hex) +{ + char params[32768]; int32_t len = 0; + if ( hex != 0 && hex[0] != 0 ) + { + len = (int32_t)strlen(hex) >> 1; + if ( len < sizeof(params)-1 ) + decode_hex((uint8_t *)params,(int32_t)strlen(hex),hex); + else len = 0; + } + params[len] = 0; + return(bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,function,params)); +} + +TWO_STRINGS(zcash,passthru,function,hex) +{ + if ( (coin= iguana_coinfind("ZEC")) != 0 ) + return(dpow_passthru(coin,function,hex)); + else return(clonestr("{\"error\":\"ZEC not active, start in bitcoind mode\"}")); +} + +TWO_STRINGS(komodo,passthru,function,hex) +{ + if ( (coin= iguana_coinfind("KMD")) != 0 ) + return(dpow_passthru(coin,function,hex)); + else return(clonestr("{\"error\":\"KMD not active, start in bitcoind mode\"}")); +} + +THREE_STRINGS(iguana,passthru,asset,function,hex) +{ + if ( asset != 0 && (coin= iguana_coinfind(asset)) != 0 ) + return(dpow_passthru(coin,function,hex)); + else return(clonestr("{\"error\":\"assetchain not active, start in bitcoind mode\"}")); +} + +TWO_STRINGS(dex,send,hex,handler) +{ + uint8_t data[8192]; int32_t datalen; char *retstr; + if ( hex != 0 && (datalen= is_hexstr(hex,0)) > 0 && (datalen>>1) < sizeof(data) ) + { + datalen >>= 1; + decode_hex(data,datalen,hex); + if ( handler == 0 || handler[0] == 0 ) + handler = "DEX"; + if ( (retstr= dex_reqsend(myinfo,handler,data,datalen,1,"")) == 0 ) + return(clonestr("{\"result\":\"success\"}")); + else return(retstr); + } else return(clonestr("{\"error\":\"dex send: invalid hex\"}")); +} + +STRING_ARG(dpow,pending,fiat) +{ + struct dpow_info *dp; char base[64]; int32_t i; + if ( fiat != 0 && fiat[0] != 0 ) + { + for (i=0; fiat[i]!=0; i++) + base[i] = toupper((int32_t)fiat[i]); + base[i] = 0; + for (i=0; inumdpows; i++) + { + dp = &myinfo->DPOWS[i]; + if ( strcmp(dp->symbol,base) == 0 ) + return(jprint(dpow_withdraws_pending(dp),1)); + } + } + return(clonestr("[]")); +} + +STRING_ARG(dpow,bindaddr,ipaddr) +{ + uint32_t ipbits; char checkbuf[64]; + if ( ipaddr != 0 && ipaddr[0] != 0 ) + { + ipbits = (uint32_t)calc_ipbits(ipaddr); + expand_ipbits(checkbuf,ipbits); + if ( strcmp(ipaddr,checkbuf) == 0 ) + { + strcpy(myinfo->bindaddr,ipaddr); + return(clonestr("{\"result\":\"success\"}")); + } else return(clonestr("{\"error\":\"invalid bind ipaddr\"}")); + } else return(clonestr("{\"error\":\"no bind ipaddr\"}")); +} + +STRING_ARG(iguana,addnotary,ipaddr) +{ + static int32_t didinit; + if ( didinit == 0 ) + { + dpow_addresses(); + didinit = 1; + } + printf("addnotary (%s) -> (%s)\n",ipaddr,myinfo->ipaddr); + dpow_nanomsginit(myinfo,ipaddr); + return(clonestr("{\"result\":\"notary node added\"}")); +} + +char NOTARY_CURRENCIES[][65] = { + "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "BOTS", "MGW", "COQUI", "WLC", "KV", "CEAL", "MESH", "MNZ", "CHIPS", "MSHARK", "AXO", "ETOMIC", "BTCH", "VOTE2018", "NINJA", "OOT", "CHAIN", "BNTN", "PRLPAY" +}; + +// "LTC", "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF", "NZD", "CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK", + +void _iguana_notarystats(char *fname,int32_t totals[64],int32_t dispflag) +{ + FILE *fp; uint64_t signedmask; long fpos,startfpos; int32_t i,height,iter,prevheight; + if ( (fp= fopen(fname,"rb")) != 0 ) + { + printf("opened %s\n",fname); + startfpos = 0; + prevheight = -1; + for (iter=0; iter<2; iter++) + { + while ( 1 ) + { + fpos = ftell(fp); + if (fread(&height,1,sizeof(height),fp) == sizeof(height) && fread(&signedmask,1,sizeof(signedmask),fp) == sizeof(signedmask) ) + { + //printf("%6d %016llx\n",height,(long long)signedmask); + if ( height < prevheight ) + { + startfpos = fpos; + if ( iter == 0 ) + printf("found reversed height %d vs %d\n",height,prevheight); + else printf("fpos.%ld fatal unexpected height reversal %d vs %d\n",fpos,height,prevheight); + } + if ( iter == 1 && (height >= 180000 || strcmp(fname,"signedmasks") != 0) ) + { + for (i=0; i<64; i++) + { + if ( ((1LL << i) & signedmask) != 0 ) + { + totals[i]++; + if ( dispflag > 1 ) + printf("%2d ",i); + } + } + if ( dispflag > 1 ) + printf("height.%d %016llx %s\n",height,(long long)signedmask,fname); + } + prevheight = height; + } else break; + } + if ( iter == 0 ) + { + prevheight = -1; + fseek(fp,startfpos,SEEK_SET); + printf("set startfpos %ld\n",startfpos); + } + } + fclose(fp); + if ( dispflag != 0 ) + { + printf("after %s\n",fname); + for (i=0; i= DPOW_MIN_ASSETCHAIN_SIGS ) + { + notarymask = numnotaries = 0; + for (i=0; i>= 1; + decode_hex(script,len,hexstr); + if ( script[0] == 33 && script[34] == 0xac ) + { + for (j=0; j 0 ) + { + if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) + { + hasnotarization = 1; + *nothtp = 0; + if ( (vouts= jarray(&numvouts,txobj,"vout")) != 0 ) + { + bits256 blockhash,txid,MoM; uint32_t MoMdepth; char symbol[65];//,str[65],str2[65],str3[65]; + vout = jitem(vouts,numvouts-1); + if ( (sobj= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(sobj,"hex")) != 0 && (len= is_hexstr(hexstr,0)) > 36*2 && len < sizeof(script)*2 ) + { + len >>= 1; + decode_hex(script,len,hexstr); + if ( dpow_opreturn_parsesrc(&blockhash,nothtp,&txid,symbol,&MoM,&MoMdepth,script,len,mdata) > 0 && strcmp(symbol,coin->symbol) == 0 ) + { + // if ( Notaries_port != DPOW_SOCKPORT ) // keep going till valid MoM found, useful for new chains without any MoM + { + if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 || *nothtp >= height || *nothtp < 0 ) + { + *nothtp = 0; + } + } + if ( mdata->pairs != 0 && mdata->numpairs > 0 ) + { + for (j=0; jnumpairs; j++) + { + if ( mdata->pairs[j].notarization_height > coin->MoMoMheight ) + { + coin->MoMoMheight = mdata->pairs[j].notarization_height; + printf("set %s MoMoMheight <- %d\n",coin->symbol,coin->MoMoMheight); + } + } + } + //printf("%s.%d notarizationht.%d %s -> %s MoM.%s [%d]\n",symbol,height,*nothtp,bits256_str(str,blockhash),bits256_str(str2,txid),bits256_str(str3,MoM),MoMdepth); + } + } + } + } + } + } + } + free_json(txobj); + } + if ( hasnotarization != 0 ) + (*signedmaskp) = notarymask; + return(hasnotarization); +} + +int32_t dpow_hasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supernet_info *myinfo,struct iguana_info *coin,cJSON *blockjson,int32_t ht,struct komodo_ccdataMoMoM *mdata) +{ + int32_t i,n,hasnotarization = 0; bits256 txid; cJSON *txarray; + *nothtp = 0; + *signedmaskp = 0; + memset(mdata,0,sizeof(*mdata)); + if ( (txarray= jarray(&n,blockjson,"tx")) != 0 ) + { + for (i=0; i maxheight ) + break; + blockhash = dpow_getblockhash(myinfo,coin,ht); + if ( (blockjson= dpow_getblock(myinfo,coin,blockhash)) != 0 ) + { + if ( dpow_hasnotarization(&signedmask,¬ht,myinfo,coin,blockjson,ht,&mdata) > 0 ) + { + if ( mdata.pairs != 0 ) + free(mdata.pairs); + for (j=0; j<64; j++) + if ( ((1LL << j) & signedmask) != 0 ) + masksums[j]++; + } + free_json(blockjson); + } + } + array = cJSON_CreateArray(); + for (i=0; i current - numblocks ) + { + printf("ht.%d %llx vs current.%d - %d\n",height,(long long)signedmask,current,numblocks); + for (j=0; j<64; j++) + if ( ((1LL << j) & signedmask) != 0 ) + vals[j] += (double)DPOW_UTXOSIZE / SATOSHIDEN; + } + } else break; + } + fclose(fp); + } else return(clonestr("{\"error\":\"cant open signedmasks\"}")); + for (sum=j=0; j 0. ) + { + bitcoin_address(coinaddr,0,pubkeys[j],33); // fixed + sprintf(cmd,"bitcoin-cli sendtoaddress %s %f\n",coinaddr,val); + if ( sendflag != 0 && system(cmd) != 0 ) + printf("ERROR with (%s)\n",cmd); + else + { + printf("%s\n",cmd); + sum += val; + } + } + } + printf("%s sent %.8f BTC\n",sendflag!=0?"":"would have",sum); + return(clonestr("{\"result\":\"success\"}")); + } + else return(clonestr("{\"error\":\"cant find BTC\"}")); + } + for (i=0; iDPOWS[0].lastrecvmask; + for (i=0; i>= 1; + memset(data,0,sizeof(data)); + decode_hex(data,len,maskhex); + for (i=0; iDPOWS[0].cancelratify = 1; + return(clonestr("{\"result\":\"queued dpow cancel ratify\"}")); +} + +TWOINTS_AND_ARRAY(dpow,ratify,minsigs,timestamp,ratified) +{ + void **ptrs; bits256 zero; int32_t i; char *source; struct dpow_checkpoint checkpoint; + if ( ratified == 0 ) + return(clonestr("{\"error\":\"no ratified list for dpow ratify\"}")); + memset(zero.bytes,0,sizeof(zero)); + dpow_checkpointset(myinfo,&checkpoint,0,zero,timestamp,timestamp); + ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint)); + ptrs[0] = (void *)myinfo; + if ( (source= jstr(json,"source")) == 0 ) + source = "KMD"; + ptrs[1] = (void *)&myinfo->DPOWS[0]; + for (i=0; inumdpows; i++) + if ( strcmp(myinfo->DPOWS[0].symbol,source) == 0 ) + { + ptrs[1] = (void *)&myinfo->DPOWS[i]; + break; + } + ptrs[2] = (void *)(long)minsigs; + ptrs[3] = (void *)DPOW_RATIFYDURATION; + ptrs[4] = (void *)jprint(ratified,0); + memcpy(&ptrs[5],&checkpoint,sizeof(checkpoint)); + myinfo->DPOWS[0].cancelratify = 0; + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)dpow_statemachinestart,(void *)ptrs) != 0 ) + { + } + return(clonestr("{\"result\":\"started ratification\"}")); +} + +HASH_AND_STRING(dex,gettransaction,txid,symbol) +{ + /*char str[65],url[1024],*retstr; + if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && myinfo->blocktrail_apikey[0] != 0 ) + { + sprintf(url,"https://api.blocktrail.com/v1/btc/transaction/%s?api_key=%s",bits256_str(str,txid),myinfo->blocktrail_apikey); + + sprintf(url,"https://api.blocktrail.com/v1/btc/address/%s/unspent-outputs?api_key=%s",address,myinfo->blocktrail_apikey); + }*/ + return(_dex_getrawtransaction(myinfo,symbol,txid)); +} + +HASH_AND_STRING_AND_INT(dex,gettxout,txid,symbol,vout) +{ + /*char str[65],url[1024],*retstr; + if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && myinfo->blocktrail_apikey[0] != 0 ) + { + sprintf(url,"https://api.blocktrail.com/v1/btc/transaction/%s?api_key=%s",bits256_str(str,txid),myinfo->blocktrail_apikey); + }*/ + return(_dex_gettxout(myinfo,symbol,txid,vout)); +} + +TWO_STRINGS(dex,listunspent,symbol,address) +{ + if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && myinfo->blocktrail_apikey[0] != 0 ) + { + char url[1024],*retstr,*coinaddr,*script; int32_t i,n,vout; cJSON *retjson,*data,*item,*item3,*data3; bits256 txid; uint64_t val; + sprintf(url,"https://api.blocktrail.com/v1/btc/address/%s/unspent-outputs?api_key=%s",address,myinfo->blocktrail_apikey); + if ( (retstr= issue_curl(url)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + data = jarray(&n,retjson,"data"); + data3 = cJSON_CreateArray(); + //[{"hash":"e0a40dac21103e92e0dc9311a0233640489afc5beb5ba3b009848a8e9151dc55","time":"2017-02-21T16:48:28+0000","confirmations":1,"is_coinbase":false,"value":4100000,"index":1,"address":"19rjYdJtRN3qoammX3r1gxy9bvh8p8DmRc","type":"pubkeyhash","multisig":null,"script":"OP_DUP OP_HASH160 6128e7459989d35d530bcd4066c9aaf1f925430a OP_EQUALVERIFY OP_CHECKSIG","script_hex":"76a9146128e7459989d35d530bcd4066c9aaf1f925430a88ac"}] + /*{ + "txid" : "e95d3083baf733dfda2fcd1110fe2937cb3580f8b1b237aad547528440dfa873", + "vout" : 1, + "address" : "RNgdefRo2iRLWqDXEogJrsTw35MgDPQP4R", + "account" : "", + "scriptPubKey" : "76a91493088c5f3546225e0ef6ba9c9c6a74d4c2df877388ac", + "amount" : 150.00000000, + "interest" : 0.30000000, + "confirmations" : 20599, + "spendable" : true + }*/ + for (i=0; iFULLNODE < 0 ) + return(jprint(dpow_listunspent(myinfo,coin,address),1)); + //printf("call _dex_listunspent\n"); + return(_dex_listunspent(myinfo,symbol,address)); +} + +TWO_STRINGS_AND_TWO_DOUBLES(dex,listtransactions,symbol,address,count,skip) +{ + if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && myinfo->blocktrail_apikey[0] != 0 ) + { + char url[1024],*retstr,*retstr2; cJSON *retjson,*retjson2,*retjson3,*data,*data2; int32_t i,n; + sprintf(url,"https://api.blocktrail.com/v1/btc/address/%s/transactions?api_key=%s",address,myinfo->blocktrail_apikey); + if ( (retstr= issue_curl(url)) != 0 ) + { + sprintf(url,"https://api.blocktrail.com/v1/btc/address/%s/unconfirmed-transactions?api_key=%s",address,myinfo->blocktrail_apikey); + if ( (retstr2= issue_curl(url)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 && (retjson2= cJSON_Parse(retstr2)) != 0 ) + { + data = jarray(&n,retjson,"data"); + data2 = jarray(&n,retjson2,"data"); + retjson3 = jduplicate(data); + if ( n > 0 ) + { + for (i=0; i (%s)\n",retstr,retstr2,jprint(retjson3,0)); + free(retstr); + free(retstr2); + free_json(retjson); + free_json(retjson2); + return(jprint(retjson3,1)); + } + } + } + } + return(_dex_listtransactions(myinfo,symbol,address,count,skip)); +} + +STRING_ARG(dex,getinfo,symbol) +{ + return(_dex_getinfo(myinfo,symbol)); +} + +STRING_ARG(dex,getbestblockhash,symbol) +{ + return(_dex_getbestblockhash(myinfo,symbol)); +} + +STRING_ARG(dex,alladdresses,symbol) +{ + return(_dex_alladdresses(myinfo,symbol)); +} + +STRING_AND_INT(dex,getblockhash,symbol,height) +{ + return(_dex_getblockhash(myinfo,symbol,height)); +} + +HASH_AND_STRING(dex,getblock,hash,symbol) +{ + return(_dex_getblock(myinfo,symbol,hash)); +} + +TWO_STRINGS(dex,sendrawtransaction,symbol,signedtx) +{ + return(_dex_sendrawtransaction(myinfo,symbol,signedtx)); +} + +TWO_STRINGS(dex,importaddress,symbol,address) +{ + return(_dex_importaddress(myinfo,symbol,address)); +} + +TWO_STRINGS(dex,checkaddress,symbol,address) +{ + return(_dex_checkaddress(myinfo,symbol,address)); +} + +TWO_STRINGS(dex,validateaddress,symbol,address) +{ + return(_dex_validateaddress(myinfo,symbol,address)); +} + +STRING_ARG(dex,getmessage,argstr) +{ + return(_dex_getmessage(myinfo,argstr)); +} + +STRING_ARG(dex,psock,argstr) +{ + return(_dex_psock(myinfo,argstr)); +} + +STRING_ARG(dex,getnotaries,symbol) +{ + return(clonestr("{\"error\":\"dexgetnotaries deprecated\"}")); + //return(_dex_getnotaries(myinfo,symbol)); +} + +TWO_STRINGS(dex,kvsearch,symbol,key) +{ + if ( key == 0 || key[0] == 0 ) + return(clonestr("{\"error\":\"kvsearch parameter error\"}")); + return(_dex_kvsearch(myinfo,symbol,key)); +} + +THREE_STRINGS_AND_THREE_INTS(dex,kvupdate,symbol,key,value,flags,unused,unusedb) +{ + // need to have some micropayments between client/server, otherwise receiving server incurs costs + if ( key == 0 || key[0] == 0 || value == 0 || value[0] == 0 ) + return(clonestr("{\"error\":\"kvupdate parameter error\"}")); + if ( strcmp(symbol,"KV") == 0 ) + { + if ( flags > 1 ) + return(clonestr("{\"error\":\"only single duration updates via remote access\"}")); + else if ( strlen(key) > 64 || strlen(value) > 256 ) + return(clonestr("{\"error\":\"only keylen <=64 and valuesize <= 256 allowed via remote access\"}")); + else + { + //printf("call _dex_kvupdate.(%s) -> (%s) flags.%d\n",key,value,flags); + return(_dex_kvupdate(myinfo,symbol,key,value,flags)); + } + } else return(clonestr("{\"error\":\"free updates only on KV chain\"}")); +} + +#include "kmd_lookup.h" + +TWO_STRINGS(dex,listunspent2,symbol,address) +{ + cJSON *retjson; + if ( myinfo->DEXEXPLORER != 0 ) + { + if ( symbol != 0 && address != 0 && (coin= iguana_coinfind(symbol)) != 0 ) + { + if ( coin != 0 ) + coin->DEXEXPLORER = myinfo->DEXEXPLORER * myinfo->IAMNOTARY * (iguana_isnotarychain(coin->symbol) >= 0); + if ( strcmp(coin->symbol,"BTC") == 0 || coin->DEXEXPLORER == 0 ) + return(clonestr("[]")); + if ( (retjson= kmd_listunspent(myinfo,coin,address)) != 0 ) + return(jprint(retjson,1)); + } + } + if ( symbol != 0 && address != 0 ) + return(_dex_listunspent2(myinfo,symbol,address)); + else return(clonestr("{\"error\":\"dex listunspent2 null symbol, address or coin\"}")); +} + +TWO_STRINGS_AND_TWO_DOUBLES(dex,listtransactions2,symbol,address,count,skip) +{ + cJSON *retjson; + if ( myinfo->DEXEXPLORER != 0 ) + { + if ( symbol != 0 && address != 0 && (coin= iguana_coinfind(symbol)) != 0 ) + { + if ( coin != 0 ) + coin->DEXEXPLORER = myinfo->DEXEXPLORER * myinfo->IAMNOTARY * (iguana_isnotarychain(coin->symbol) >= 0); + if ( strcmp(coin->symbol,"BTC") == 0 || coin->DEXEXPLORER == 0 ) + return(clonestr("[]")); + if ( (retjson= kmd_listtransactions(myinfo,coin,address,count,skip)) != 0 ) + return(jprint(retjson,1)); + } + } + if ( symbol != 0 && address != 0 ) + return(_dex_listtransactions2(myinfo,symbol,address,count,skip)); + else return(clonestr("{\"error\":\"dex listunspent2 null symbol, address or coin\"}")); +} + +HASH_AND_STRING_AND_INT(dex,gettxin,txid,symbol,vout) +{ + if ( myinfo->DEXEXPLORER != 0 ) + { + if ( symbol != 0 && (coin= iguana_coinfind(symbol)) != 0 && coin->DEXEXPLORER != 0 ) + return(jprint(kmd_gettxin(coin,txid,vout),1)); + if ( coin != 0 ) + coin->DEXEXPLORER = myinfo->DEXEXPLORER * myinfo->IAMNOTARY * (iguana_isnotarychain(coin->symbol) >= 0); + } + if ( symbol != 0 ) + return(_dex_gettxin(myinfo,symbol,txid,vout)); + else return(clonestr("{\"error\":\"dex gettxin null symbolor coin\"}")); +} + +TWO_STRINGS(dex,listspent,symbol,address) +{ + if ( myinfo->DEXEXPLORER != 0 ) + { + if ( symbol != 0 && address != 0 && (coin= iguana_coinfind(symbol)) != 0 && coin->DEXEXPLORER != 0 ) + return(jprint(kmd_listspent(myinfo,coin,address),1)); + if ( coin != 0 ) + coin->DEXEXPLORER = myinfo->DEXEXPLORER * myinfo->IAMNOTARY * (iguana_isnotarychain(coin->symbol) >= 0); + } + if ( symbol != 0 && address != 0 ) + return(_dex_listspent(myinfo,symbol,address)); + else return(clonestr("{\"error\":\"dex listspent null symbol, address or coin\"}")); +} + +TWO_STRINGS(dex,getbalance,symbol,address) +{ + char url[512],*retstr; cJSON *retjson; uint64_t val; + if ( myinfo->DEXEXPLORER != 0 ) + { + //printf("DEXEXPLORER\n"); + if ( symbol != 0 && address != 0 && (coin= iguana_coinfind(symbol)) != 0 && coin->DEXEXPLORER != 0 ) + return(jprint(kmd_getbalance(myinfo,coin,address),1)); + if ( coin != 0 ) + coin->DEXEXPLORER = myinfo->DEXEXPLORER * myinfo->IAMNOTARY * (iguana_isnotarychain(coin->symbol) >= 0); + } + if ( symbol != 0 && address != 0 ) + { + if ( strcmp(symbol,"BTC") == 0 && myinfo->blocktrail_apikey[0] != 0 ) + { + sprintf(url,"https://api.blocktrail.com/v1/btc/address/%s?api_key=%s",address,myinfo->blocktrail_apikey); + if ( (retstr= issue_curl(url)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + //printf("balance\n"); + if ( (val= j64bits(retjson,"balance")) != 0 ) + { + jdelete(retjson,"balance"); + jaddnum(retjson,"balance",dstr(val)); + } + //printf("sent\n"); + if ( (val= j64bits(retjson,"sent")) != 0 ) + { + jdelete(retjson,"sent"); + jaddnum(retjson,"sent",dstr(val)); + } + //printf("received\n"); + if ( (val= j64bits(retjson,"received")) != 0 ) + { + jdelete(retjson,"received"); + jaddnum(retjson,"received",dstr(val)); + } + //printf("unconfirmed_sent\n"); + if ( (val= j64bits(retjson,"unconfirmed_sent")) != 0 ) + { + jdelete(retjson,"unconfirmed_sent"); + jaddnum(retjson,"unconfirmed_sent",dstr(val)); + } + //printf("unconfirmed_received\n"); + if ( (val= j64bits(retjson,"unconfirmed_received")) != 0 ) + { + jdelete(retjson,"unconfirmed_received"); + jaddnum(retjson,"unconfirmed_received",dstr(val)); + } + //printf("blocktrail.(%s) -> (%s)\n",retstr,jprint(retjson,0)); + free(retstr); + retstr = jprint(retjson,1); + } + } + return(retstr); + } + return(_dex_getbalance(myinfo,symbol,address)); + } else return(clonestr("{\"error\":\"dex getbalance null symbol, address or coin\"}")); +} + +STRING_ARG(dex,explorer,symbol) +{ + if ( symbol != 0 && (coin= iguana_coinfind(symbol)) != 0 ) + { + myinfo->DEXEXPLORER = 1; + coin->DEXEXPLORER = 1; + return(clonestr("{\"result\":\"success\"}")); + } + return(clonestr("{\"error\":\"coin not active\"}")); +} + +#include "../includes/iguana_apiundefs.h" diff --git a/iguana/dpow/dPoW.h b/iguana/dpow/dPoW.h index 163c640a3..c8d75a19d 100755 --- a/iguana/dpow/dPoW.h +++ b/iguana/dpow/dPoW.h @@ -21,6 +21,7 @@ #define DPOW_FIRSTRATIFY 1000 #define DPOW_CHECKPOINTFREQ 10 +#define DPOW_MAXFREQ 100 #define DPOW_MINSIGS 13 #define DPOW_MIN_ASSETCHAIN_SIGS 11 //#define DPOW_M(bp) ((bp)->minsigs) // (((bp)->numnotaries >> 1) + 1) @@ -137,7 +138,7 @@ struct dpow_info struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE]; bits256 activehash,lastnotarized,srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; uint32_t SRCREALTIME,lastsrcupdate,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify; - int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying; + int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying,minsigs,freq; struct pax_transaction *PAX; portable_mutex_t paxmutex,dexmutex; uint32_t ipbits[128],numipbits; diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 4b2683a5d..47ddaa751 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -167,7 +167,7 @@ struct supernet_info uint8_t *pingbuf; struct basilisk_request DEXaccept; FILE *dexfp; - struct dpow_info DPOWS[1024]; int32_t numdpows,dpowsock,dexsock,pubsock,repsock,subsock,reqsock; + struct dpow_info *DPOWS; int32_t maxdpows,numdpows,dpowsock,dexsock,pubsock,repsock,subsock,reqsock; struct delayedPoW_info dPoW; struct basilisk_spend *spends; int32_t numspends; char bindaddr[64]; diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index d614de1b9..f307971ed 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -61,10 +61,10 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime) { //struct komodo_ccdataMoMoM mdata; cJSON *blockjson; uint64_t signedmask; struct iguana_info *coin; - void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t freq,minsigs,i,ht; struct dpow_block *bp; + void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t i,ht; struct dpow_block *bp; dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime); checkpoint = dp->srcfifo[dp->srcconfirms]; - if ( strcmp("BTC",dp->dest) == 0 ) + /*if ( strcmp("BTC",dp->dest) == 0 ) { freq = DPOW_CHECKPOINTFREQ; minsigs = Notaries_BTCminsigs; //DPOW_MINSIGS; @@ -72,10 +72,10 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he else { minsigs = Notaries_minsigs; //DPOW_MIN_ASSETCHAIN_SIGS; - if ( strcmp("CHIPS",dp->symbol) == 0 ) - freq = 100; + if ( strcmp("CHIPS",dp->symbol) == 0 || strncmp("TEST",dp->symbol,4) == 0) + freq = DPOW_MAXFREQ; else freq = 1; - } + }*/ dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); /*if ( strcmp(dp->dest,"KMD") == 0 )//|| strcmp(dp->dest,"CHAIN") == 0 ) { @@ -119,7 +119,9 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he } else return; } else return; }*/ - if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) + if ( dp->freq <= 0 ) + dp->freq = 1; + if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % dp->freq) == 0 ) { if ( (0) && strcmp("KMD",dp->symbol) == 0 ) printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); @@ -127,7 +129,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint) + sizeof(pthread_t)); ptrs[0] = (void *)myinfo; ptrs[1] = (void *)dp; - ptrs[2] = (void *)(uint64_t)minsigs; + ptrs[2] = (void *)(uint64_t)dp->minsigs; if ( strcmp(dp->dest,"KMD") != 0 ) ptrs[3] = (void *)DPOW_DURATION; else ptrs[3] = (void *)(DPOW_DURATION * 60); // essentially try forever for assetchains @@ -138,13 +140,13 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he if ( OS_thread_create((void *)((uint64_t)&ptrs[5] + sizeof(struct dpow_checkpoint)),NULL,(void *)dpow_statemachinestart,(void *)ptrs) != 0 ) { } - if ( ht > 500 ) + if ( ht > DPOW_MAXFREQ*5 ) { if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) printf("ht.%d maxblocks.%d\n",ht,dp->maxblocks); - for (i=ht-500; i>ht-10000&&i>100; i--) + for (i=ht-DPOW_MAXFREQ*5; i>ht-DPOW_MAXFREQ*100&&i>DPOW_MAXFREQ; i--) { - if ( (i % 100) != 0 && (bp= dp->blocks[i]) != 0 && bp->state == 0xffffffff ) + if ( (i % DPOW_MAXFREQ) != 0 && (bp= dp->blocks[i]) != 0 && bp->state == 0xffffffff ) { dp->blocks[i] = 0; Numallocated--; @@ -293,9 +295,16 @@ void dpow_addresses() #include "../includes/iguana_apideclares.h" #include "../includes/iguana_apideclares2.h" -THREE_STRINGS(iguana,dpow,symbol,dest,pubkey) +THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq) { - char *retstr,srcaddr[64],destaddr[64]; struct iguana_info *src,*destcoin; cJSON *ismine; int32_t i,srcvalid,destvalid; struct dpow_info *dp = &myinfo->DPOWS[myinfo->numdpows]; + char *retstr,srcaddr[64],destaddr[64]; struct iguana_info *src,*destcoin; cJSON *ismine; int32_t i,srcvalid,destvalid; struct dpow_info *dp; + if ( myinfo->numdpows == myinfo->maxdpows ) + { + myinfo->maxdpows++; + myinfo->DPOWS = realloc(myinfo->DPOWS,sizeof(*myinfo->DPOWS) * myinfo->maxdpows); + } + dp = &myinfo->DPOWS[myinfo->numdpows]; + memset(dp,0,sizeof(*dp)); destvalid = srcvalid = 0; if ( myinfo->NOTARY.RELAYID < 0 ) { @@ -349,6 +358,20 @@ THREE_STRINGS(iguana,dpow,symbol,dest,pubkey) } if ( dp->srcconfirms > DPOW_FIFOSIZE ) dp->srcconfirms = DPOW_FIFOSIZE; + if ( strcmp("BTC",dp->dest) == 0 ) + { + dp->freq = DPOW_CHECKPOINTFREQ; + dp->minsigs = Notaries_BTCminsigs; //DPOW_MINSIGS; + } + else + { + dp->minsigs = Notaries_minsigs; //DPOW_MIN_ASSETCHAIN_SIGS; + if ( strcmp("CHIPS",dp->symbol) == 0 || strncmp("TEST",dp->symbol,4) == 0) + dp->freq = DPOW_MAXFREQ; + else if ( freq >= 2 ) + dp->freq = freq; + else dp->freq = 1; + } src = iguana_coinfind(dp->symbol); destcoin = iguana_coinfind(dp->dest); if ( src == 0 || destcoin == 0 ) @@ -381,7 +404,7 @@ THREE_STRINGS(iguana,dpow,symbol,dest,pubkey) } for (i=0; i<33; i++) printf("%02x",dp->minerkey33[i]); - printf(" DPOW with pubkey.(%s) %s.valid%d %s -> %s %s.valid%d\n",tmp,srcaddr,srcvalid,dp->symbol,dp->dest,destaddr,destvalid); + printf(" DPOW with pubkey.(%s) %s.valid%d %s -> %s %s.valid%d, num.%d/max.%d\n",tmp,srcaddr,srcvalid,dp->symbol,dp->dest,destaddr,destvalid,myinfo->numdpows,myinfo->maxdpows); if ( srcvalid <= 0 || destvalid <= 0 ) { dp->symbol[0] = 0; @@ -394,7 +417,7 @@ THREE_STRINGS(iguana,dpow,symbol,dest,pubkey) } if ( dp->blocks == 0 ) { - dp->maxblocks = 1000000; + dp->maxblocks = 10000; dp->blocks = calloc(dp->maxblocks,sizeof(*dp->blocks)); } portable_mutex_init(&dp->paxmutex); diff --git a/includes/iguana_apideclares.h b/includes/iguana_apideclares.h index 666e1f4bc..46db910d3 100755 --- a/includes/iguana_apideclares.h +++ b/includes/iguana_apideclares.h @@ -174,7 +174,7 @@ STRING_AND_INT(iguana,snapshot,symbol,height); INT_ARRAY_STRING(iguana,dividends,height,vals,symbol); THREE_STRINGS(iguana,passthru,asset,function,hex); STRING_ARG(iguana,initfastfind,activecoin); -THREE_STRINGS(iguana,dpow,symbol,dest,pubkey); +THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq); STRING_ARG(iguana,peers,activecoin); STRING_AND_INT(iguana,maxpeers,activecoin,max); STRING_ARG(iguana,getconnectioncount,activecoin); From 3ea2021255aa6271a42a0ba4c1dc20924dfa58dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Apr 2018 12:54:11 +0300 Subject: [PATCH 61/98] Fix duplicate files --- iguana/dPoW.h | 5 +- iguana/dpow/dPoW.h | 229 --------------------------------------------- 2 files changed, 3 insertions(+), 231 deletions(-) delete mode 100755 iguana/dpow/dPoW.h diff --git a/iguana/dPoW.h b/iguana/dPoW.h index b7f4769c3..e3a37118b 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -16,10 +16,11 @@ #ifndef INCLUDE_DPOW_H #define INCLUDE_DPOW_H -#define DPOW_MAXMOMDEPTH (1440 * 7) +//#define DPOW_MAXMOMDEPTH (1440 * 7) #define DPOW_FIRSTRATIFY 1000 +#define DPOW_MAXFREQ 100 #define DPOW_CHECKPOINTFREQ 10 #define DPOW_MINSIGS 13 #define DPOW_MIN_ASSETCHAIN_SIGS 11 @@ -137,7 +138,7 @@ struct dpow_info struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE]; bits256 activehash,lastnotarized,srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; uint32_t SRCREALTIME,lastsrcupdate,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify; - int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying; + int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying,minsigs,freq; struct pax_transaction *PAX; portable_mutex_t paxmutex,dexmutex; uint32_t ipbits[128],numipbits; diff --git a/iguana/dpow/dPoW.h b/iguana/dpow/dPoW.h deleted file mode 100755 index c8d75a19d..000000000 --- a/iguana/dpow/dPoW.h +++ /dev/null @@ -1,229 +0,0 @@ -/****************************************************************************** - * Copyright © 2014-2018 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - -#ifndef INCLUDE_DPOW_H -#define INCLUDE_DPOW_H - -#define DPOW_MAXMOMDEPTH (1440) - -#define DPOW_FIRSTRATIFY 1000 - -#define DPOW_CHECKPOINTFREQ 10 -#define DPOW_MAXFREQ 100 -#define DPOW_MINSIGS 13 -#define DPOW_MIN_ASSETCHAIN_SIGS 11 -//#define DPOW_M(bp) ((bp)->minsigs) // (((bp)->numnotaries >> 1) + 1) -#define DPOW_MODIND(bp,offset) (((((bp)->height / DPOW_CHECKPOINTFREQ) % (bp)->numnotaries) + (offset)) % (bp)->numnotaries) -#define DPOW_VERSION 0x1782 -#define DPOW_UTXOSIZE 10000//50000 -#define DPOW_MINOUTPUT 6000 -#define DPOW_DURATION 600 -#define DPOW_RATIFYDURATION (3600 * 24) - -//#define DPOW_ENTRIESCHANNEL ('e' | ('n' << 8) | ('t' << 16) | ('r' << 24)) -//#define DPOW_BTCENTRIESCHANNEL (~DPOW_ENTRIESCHANNEL) -//#define DPOW_UTXOCHANNEL ('d' | ('P' << 8) | ('o' << 16) | ('W' << 24)) -#define DPOW_SIGCHANNEL ('s' | ('i' << 8) | ('g' << 16) | ('s' << 24)) -#define DPOW_SIGBTCCHANNEL (~DPOW_SIGCHANNEL) -#define DPOW_TXIDCHANNEL ('t' | ('x' << 8) | ('i' << 16) | ('d' << 24)) -#define DPOW_BTCTXIDCHANNEL (~DPOW_TXIDCHANNEL) - - -#define DPOW_FIFOSIZE 64 -#define DPOW_MAXTX 8192 -#define DPOW_THIRDPARTY_CONFIRMS 0 -#define DPOW_KOMODOCONFIRMS 10 -#define DPOW_BTCCONFIRMS 1 -#define DPOW_MAXRELAYS 64 -#define DPOW_MAXSIGLEN 128 - -#define DEX_VERSION 0x0105 -#define DPOW_SOCKPORT 7775 -#define DEX_SOCK 7774 -#define PUB_SOCK 7773 -#define REP_SOCK 7772 - -#define DPOW_EPOCHDURATION 600 - -struct dpow_coinentry -{ - bits256 prev_hash; - uint8_t siglens[DPOW_MAXRELAYS],sigs[DPOW_MAXRELAYS][DPOW_MAXSIGLEN]; - int32_t prev_vout; -}; - -struct dpow_utxoentry -{ - bits256 srchash,desthash,commit,hashmsg; - uint64_t recvmask,othermasks[DPOW_MAXRELAYS]; - int32_t srcvout,destvout,height; - int8_t bestk; uint8_t pubkey[33]; -}; - -struct dpow_entry -{ - bits256 commit,beacon,ratifysrcutxo,ratifydestutxo; - uint64_t masks[2][DPOW_MAXRELAYS],recvmask,othermask,bestmask,ratifyrecvmask,ratifybestmask; - int32_t height; uint32_t pendingcrcs[2],paxwdcrc; - uint16_t ratifysrcvout,ratifydestvout; - int8_t bestk,ratifybestk; - uint8_t pubkey[33],ratifysigs[2][DPOW_MAXSIGLEN],ratifysiglens[2]; - struct dpow_coinentry src,dest; -}; - -struct dpow_sigentry -{ - bits256 beacon; - uint64_t mask; - int32_t refcount; - uint8_t senderind,lastk,siglen,sig[DPOW_MAXSIGLEN],senderpub[33]; -}; - -struct komodo_notaries -{ - struct basilisk_relay RELAYS[DPOW_MAXRELAYS]; - int32_t NUMRELAYS,RELAYID; -}; - -struct dpow_hashheight { bits256 hash; int32_t height; }; - -struct dpow_checkpoint -{ - struct dpow_hashheight blockhash,approved; - bits256 miner; uint32_t blocktime,timestamp; -}; - -struct dpow_block -{ - bits256 hashmsg,desttxid,srctxid,beacon,commit,MoM; - struct iguana_info *srccoin,*destcoin; char *opret_symbol; - uint64_t destsigsmasks[DPOW_MAXRELAYS],srcsigsmasks[DPOW_MAXRELAYS]; - uint64_t recvmask,bestmask,ratifybestmask,ratifyrecvmask,pendingbestmask,pendingratifybestmask,ratifysigmasks[2]; - struct dpow_entry notaries[DPOW_MAXRELAYS]; - uint32_t MoMdepth,state,starttime,timestamp,waiting,sigcrcs[2],txidcrcs[2],utxocrcs[2],lastepoch,paxwdcrc; - int32_t rawratifiedlens[2],height,numnotaries,numerrors,completed,minsigs,duration,numratified,isratify,require0,scores[DPOW_MAXRELAYS]; - int8_t myind,bestk,ratifybestk,pendingbestk,pendingratifybestk; - cJSON *ratified; - uint8_t ratified_pubkeys[DPOW_MAXRELAYS][33],ratifysigs[2][DPOW_MAXSIGLEN],ratifysiglens[2]; - char handles[DPOW_MAXRELAYS][32]; - char signedtx[32768]; uint8_t ratifyrawtx[2][32768]; uint32_t pendingcrcs[2]; -}; - -struct pax_transaction -{ - UT_hash_handle hh; - bits256 txid; - uint64_t komodoshis,fiatoshis; - int32_t marked,height,kmdheight; - uint16_t vout; - char symbol[16],coinaddr[64]; uint8_t rmd160[20],shortflag; -}; - -struct dpow_info -{ - char symbol[16],dest[16]; uint8_t minerkey33[33],minerid; uint64_t lastrecvmask; - struct dpow_checkpoint checkpoint,last,destchaintip,srcfifo[DPOW_FIFOSIZE],destfifo[DPOW_FIFOSIZE]; - struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE]; - bits256 activehash,lastnotarized,srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; - uint32_t SRCREALTIME,lastsrcupdate,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify; - int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG,ratifying,minsigs,freq; - struct pax_transaction *PAX; - portable_mutex_t paxmutex,dexmutex; - uint32_t ipbits[128],numipbits; - struct dpow_block **blocks; -}; - -struct komodo_ccdatapair { int32_t notarization_height; uint32_t MoMoMoffset; }; - -struct komodo_ccdataMoMoM -{ - bits256 MoMoM; - int32_t kmdstarti,kmdendi,MoMoMdepth,numpairs,len; - struct komodo_ccdatapair *pairs; -}; - -uint64_t dpow_notarybestk(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp); -int32_t dpow_paxpending(uint8_t *hex,int32_t hexsize,uint32_t *paxwdcrcp,bits256 MoM,uint32_t MoMdepth,int32_t src_or_dest,struct dpow_block *bp); -void dex_updateclient(struct supernet_info *myinfo); -char *dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *data,int32_t datalen,int32_t M,char *field); -char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int32_t keylen,uint8_t *data,int32_t datalen,int32_t sendping,uint32_t duration); -int32_t dpow_getchaintip(struct supernet_info *myinfo,bits256 *merklerootp,bits256 *blockhashp,uint32_t *blocktimep,bits256 *txs,uint32_t *numtxp,struct iguana_info *coin); -void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen); -int32_t dpow_nanomsg_update(struct supernet_info *myinfo); -int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits256 *txidp,int32_t *voutp,char *coinaddr,char *srccoin); -void komodo_assetcoins(int32_t fullnode,uint64_t mask); -int32_t iguana_isnotarychain(char *symbol); - -cJSON *dpow_getinfo(struct supernet_info *myinfo,struct iguana_info *coin); -cJSON *dpow_gettransaction(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid); -cJSON *dpow_getblock(struct supernet_info *myinfo,struct iguana_info *coin,bits256 blockhash); -bits256 dpow_getblockhash(struct supernet_info *myinfo,struct iguana_info *coin,int32_t height); -bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *coin); -char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *signedtx); -cJSON *dpow_gettxout(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t vout); -char *dpow_importaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address); -char *dpow_validateaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address); -cJSON *dpow_listunspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); -cJSON *dpow_listtransactions(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr,int32_t count,int32_t skip); -char *dpow_alladdresses(struct supernet_info *myinfo,struct iguana_info *coin); -cJSON *dpow_kvupdate(struct supernet_info *myinfo,struct iguana_info *coin,char *key,char *value,int32_t flags); -cJSON *dpow_kvsearch(struct supernet_info *myinfo,struct iguana_info *coin,char *key); -void init_alladdresses(struct supernet_info *myinfo,struct iguana_info *coin); -cJSON *dpow_getmessage(struct supernet_info *myinfo,char *jsonstr); -cJSON *dpow_addmessage(struct supernet_info *myinfo,char *jsonstr); -cJSON *dpow_psock(struct supernet_info *myinfo,char *jsonstr); - -char *_dex_getinfo(struct supernet_info *myinfo,char *symbol); -char *_dex_getrawtransaction(struct supernet_info *myinfo,char *symbol,bits256 txid); -char *_dex_getblock(struct supernet_info *myinfo,char *symbol,bits256 hash2); -char *_dex_getblockhash(struct supernet_info *myinfo,char *symbol,int32_t height); -char *_dex_getbestblockhash(struct supernet_info *myinfo,char *symbol); -char *_dex_sendrawtransaction(struct supernet_info *myinfo,char *symbol,char *signedtx); -char *_dex_gettxout(struct supernet_info *myinfo,char *symbol,bits256 txid,int32_t vout); -char *_dex_gettxin(struct supernet_info *myinfo,char *symbol,bits256 txid,int32_t vout); -char *_dex_importaddress(struct supernet_info *myinfo,char *symbol,char *address); -char *_dex_validateaddress(struct supernet_info *myinfo,char *symbol,char *address); -char *_dex_getmessage(struct supernet_info *myinfo,char *jsonstr); -char *_dex_listunspent(struct supernet_info *myinfo,char *symbol,char *address); -char *_dex_listunspent2(struct supernet_info *myinfo,char *symbol,char *address); -char *_dex_listspent(struct supernet_info *myinfo,char *symbol,char *address); -char *_dex_getbalance(struct supernet_info *myinfo,char *symbol,char *address); -char *_dex_listtransactions(struct supernet_info *myinfo,char *symbol,char *coinaddr,int32_t count,int32_t skip); -char *_dex_listtransactions2(struct supernet_info *myinfo,char *symbol,char *coinaddr,int32_t count,int32_t skip); -char *_dex_alladdresses(struct supernet_info *myinfo,char *symbol); -int32_t _dex_getheight(struct supernet_info *myinfo,char *symbol); -char *_dex_getnotaries(struct supernet_info *myinfo,char *symbol); -char *_dex_kvupdate(struct supernet_info *myinfo,char *symbol,char *key,char *value,int32_t flags); -char *_dex_kvsearch(struct supernet_info *myinfo,char *symbol,char *key); -char *_dex_psock(struct supernet_info *myinfo,char *jsonstr); - -int32_t komodo_notaries(char *symbol,uint8_t pubkeys[64][33],int32_t height); -cJSON *dpow_checkaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address); - -void dex_channelsend(struct supernet_info *myinfo,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgid,uint8_t *data,int32_t datalen); -void kmd_bitcoinscan(); -cJSON *kmd_getbalance(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); -struct iguana_info *iguana_coinfind(char *symbol); -cJSON *kmd_listtransactions(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr,int32_t count,int32_t skip); -cJSON *kmd_listunspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); -cJSON *kmd_listspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); -cJSON *kmd_gettxin(struct iguana_info *coin,bits256 txid,int32_t vout); - -cJSON *dpow_listspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); -cJSON *dpow_getbalance(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr); -cJSON *dpow_gettxin(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t vout); - - -#endif From 436a822f569fa5193e13c6a33be0231189b1d9e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Apr 2018 12:56:16 +0300 Subject: [PATCH 62/98] Fix --- iguana/iguana_notary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index f307971ed..6fb2e69fd 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -124,7 +124,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % dp->freq) == 0 ) { if ( (0) && strcmp("KMD",dp->symbol) == 0 ) - printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),minsigs); + printf("%s/%s src ht.%d dest.%u nonz.%d %s minsigs.%d freq.%d\n",dp->symbol,dp->dest,checkpoint.blockhash.height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash),dp->minsigs,dp->freq); dpow_heightfind(myinfo,dp,checkpoint.blockhash.height + 1000); ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint) + sizeof(pthread_t)); ptrs[0] = (void *)myinfo; From 7fb8afea86ea3776a54100cc3f9a1d27d388ded9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Apr 2018 13:23:29 +0300 Subject: [PATCH 63/98] Test --- iguana/iguana_notary.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 6fb2e69fd..389150549 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -402,9 +402,6 @@ THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq) free(retstr); retstr = 0; } - for (i=0; i<33; i++) - printf("%02x",dp->minerkey33[i]); - printf(" DPOW with pubkey.(%s) %s.valid%d %s -> %s %s.valid%d, num.%d/max.%d\n",tmp,srcaddr,srcvalid,dp->symbol,dp->dest,destaddr,destvalid,myinfo->numdpows,myinfo->maxdpows); if ( srcvalid <= 0 || destvalid <= 0 ) { dp->symbol[0] = 0; @@ -427,6 +424,9 @@ THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq) //uint8_t buf[32768]; //dpow_paxpending(buf); myinfo->numdpows++; + for (i=0; i<33; i++) + printf("%02x",dp->minerkey33[i]); + printf(" DPOW with pubkey.(%s) %s.valid%d %s -> %s %s.valid%d, num.%d/max.%d freq.%d minsigs.%d\n",tmp,srcaddr,srcvalid,dp->symbol,dp->dest,destaddr,destvalid,myinfo->numdpows,myinfo->maxdpows,dp->freq,dp->minsigs); return(clonestr("{\"result\":\"success\"}")); } From 5d95c1636d21512c2703fab5b59182f0d12a5264 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Apr 2018 13:32:53 +0300 Subject: [PATCH 64/98] Change *DPOWS[] --- basilisk/basilisk.c | 6 +++--- iguana/dpow/dpow_fsm.c | 2 +- iguana/dpow/dpow_network.c | 4 ++-- iguana/iguana777.h | 2 +- iguana/iguana_notary.c | 26 ++++++++++++-------------- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 2456d30a8..1fcfaefcb 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -947,17 +947,17 @@ void basilisks_loop(void *arg) //fprintf(stderr,"E "); if ( myinfo->numdpows == 1 ) { - iguana_dPoWupdate(myinfo,&myinfo->DPOWS[0]); + iguana_dPoWupdate(myinfo,myinfo->DPOWS[0]); endmilli = startmilli + 100; } else if ( myinfo->numdpows > 1 ) { - dp = &myinfo->DPOWS[counter % myinfo->numdpows]; + dp = myinfo->DPOWS[counter % myinfo->numdpows]; iguana_dPoWupdate(myinfo,dp); //if ( (counter % myinfo->numdpows) != 0 ) { //fprintf(stderr,"F "); - iguana_dPoWupdate(myinfo,&myinfo->DPOWS[0]); + iguana_dPoWupdate(myinfo,myinfo->DPOWS[0]); } endmilli = startmilli + 30; } diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index b66bddcd0..d232fce3c 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -519,7 +519,7 @@ void dpow_statemachinestart(void *ptr) { if ( bp->isratify == 0 ) { - if ( myinfo->DPOWS[0].ratifying != 0 ) + if ( myinfo->DPOWS[0]->ratifying != 0 ) { printf("break due to already ratifying\n"); break; diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index a0c51b9e4..a39197cd1 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -2066,9 +2066,9 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) dp = 0; for (i=0; inumdpows; i++) { - if ( strcmp(np->symbol,myinfo->DPOWS[i].symbol) == 0 ) + if ( strcmp(np->symbol,myinfo->DPOWS[i]->symbol) == 0 ) { - dp = &myinfo->DPOWS[i]; + dp = myinfo->DPOWS[i]; break; } } diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 47ddaa751..0cea7f2e6 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -167,7 +167,7 @@ struct supernet_info uint8_t *pingbuf; struct basilisk_request DEXaccept; FILE *dexfp; - struct dpow_info *DPOWS; int32_t maxdpows,numdpows,dpowsock,dexsock,pubsock,repsock,subsock,reqsock; + struct dpow_info *DPOWS[8192]; int32_t numdpows,dpowsock,dexsock,pubsock,repsock,subsock,reqsock; struct delayedPoW_info dPoW; struct basilisk_spend *spends; int32_t numspends; char bindaddr[64]; diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 389150549..b3436f2bc 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -298,12 +298,10 @@ void dpow_addresses() THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq) { char *retstr,srcaddr[64],destaddr[64]; struct iguana_info *src,*destcoin; cJSON *ismine; int32_t i,srcvalid,destvalid; struct dpow_info *dp; - if ( myinfo->numdpows == myinfo->maxdpows ) - { - myinfo->maxdpows++; - myinfo->DPOWS = realloc(myinfo->DPOWS,sizeof(*myinfo->DPOWS) * myinfo->maxdpows); - } - dp = &myinfo->DPOWS[myinfo->numdpows]; + if ( (dp= myinfo->DPOWS[myinfo->numdpows]) == 0 ) + myinfo->DPOWS[myinfo->numdpows] = calloc(1,sizeof(*dp)); + if ( (dp= myinfo->DPOWS[myinfo->numdpows]) == 0 ) + return(clonestr("{\"error\":\"dPoW cant allocate memory\"}")); memset(dp,0,sizeof(*dp)); destvalid = srcvalid = 0; if ( myinfo->NOTARY.RELAYID < 0 ) @@ -339,7 +337,7 @@ THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq) if ( myinfo->numdpows > 1 ) { for (i=1; inumdpows; i++) - if ( strcmp(symbol,myinfo->DPOWS[i].symbol) == 0 ) + if ( strcmp(symbol,myinfo->DPOWS[i]->symbol) == 0 ) { dp->symbol[0] = 0; return(clonestr("{\"error\":\"cant dPoW same coin again\"}")); @@ -490,7 +488,7 @@ STRING_ARG(dpow,pending,fiat) base[i] = 0; for (i=0; inumdpows; i++) { - dp = &myinfo->DPOWS[i]; + dp = myinfo->DPOWS[i]; if ( strcmp(dp->symbol,base) == 0 ) return(jprint(dpow_withdraws_pending(dp),1)); } @@ -870,7 +868,7 @@ STRING_ARG(dpow,active,maskhex) n = komodo_notaries("KMD",pubkeys,current); if ( maskhex == 0 || maskhex[0] == 0 ) { - mask = myinfo->DPOWS[0].lastrecvmask; + mask = myinfo->DPOWS[0]->lastrecvmask; for (i=0; iDPOWS[0].cancelratify = 1; + myinfo->DPOWS[0]->cancelratify = 1; return(clonestr("{\"result\":\"queued dpow cancel ratify\"}")); } @@ -926,18 +924,18 @@ TWOINTS_AND_ARRAY(dpow,ratify,minsigs,timestamp,ratified) ptrs[0] = (void *)myinfo; if ( (source= jstr(json,"source")) == 0 ) source = "KMD"; - ptrs[1] = (void *)&myinfo->DPOWS[0]; + ptrs[1] = (void *)myinfo->DPOWS[0]; for (i=0; inumdpows; i++) - if ( strcmp(myinfo->DPOWS[0].symbol,source) == 0 ) + if ( strcmp(myinfo->DPOWS[0]->symbol,source) == 0 ) { - ptrs[1] = (void *)&myinfo->DPOWS[i]; + ptrs[1] = (void *)myinfo->DPOWS[i]; break; } ptrs[2] = (void *)(long)minsigs; ptrs[3] = (void *)DPOW_RATIFYDURATION; ptrs[4] = (void *)jprint(ratified,0); memcpy(&ptrs[5],&checkpoint,sizeof(checkpoint)); - myinfo->DPOWS[0].cancelratify = 0; + myinfo->DPOWS[0]->cancelratify = 0; if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)dpow_statemachinestart,(void *)ptrs) != 0 ) { } From 19e3e49d709f40331bf07e3fd668b4a5c5bc2fc2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Apr 2018 13:34:11 +0300 Subject: [PATCH 65/98] Test --- iguana/iguana_notary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index b3436f2bc..ecb45b3a7 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -424,7 +424,7 @@ THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq) myinfo->numdpows++; for (i=0; i<33; i++) printf("%02x",dp->minerkey33[i]); - printf(" DPOW with pubkey.(%s) %s.valid%d %s -> %s %s.valid%d, num.%d/max.%d freq.%d minsigs.%d\n",tmp,srcaddr,srcvalid,dp->symbol,dp->dest,destaddr,destvalid,myinfo->numdpows,myinfo->maxdpows,dp->freq,dp->minsigs); + printf(" DPOW with pubkey.(%s) %s.valid%d %s -> %s %s.valid%d, num.%d freq.%d minsigs.%d\n",tmp,srcaddr,srcvalid,dp->symbol,dp->dest,destaddr,destvalid,myinfo->numdpows,dp->freq,dp->minsigs); return(clonestr("{\"result\":\"success\"}")); } From c783b38e79737c3cba052dc61939bad7a1d14c4f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Apr 2018 14:14:36 +0300 Subject: [PATCH 66/98] +prints --- basilisk/basilisk_bitcoin.c | 2 +- iguana/dpow/dpow_fsm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basilisk/basilisk_bitcoin.c b/basilisk/basilisk_bitcoin.c index 969a65e7f..b78d9d8e6 100755 --- a/basilisk/basilisk_bitcoin.c +++ b/basilisk/basilisk_bitcoin.c @@ -609,7 +609,7 @@ char *iguana_utxoduplicates(struct supernet_info *myinfo,struct iguana_info *coi { if ( *completedp != 0 ) { - printf("splitfunds signedtx.(%s)\n",signedtx); + printf("splitfunds %s signedtx.(%s)\n",coin->symbol,signedtx); if ( sendflag != 0 ) iguana_sendrawtransaction(myinfo,coin,signedtx); free(rawtx); diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index d232fce3c..674b92c9c 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -509,7 +509,7 @@ void dpow_statemachinestart(void *ptr) extralen = dpow_paxpending(extras,sizeof(extras),&bp->paxwdcrc,bp->MoM,bp->MoMdepth,src_or_dest,bp); bp->notaries[bp->myind].paxwdcrc = bp->paxwdcrc; } - printf("PAXWDCRC.%x myind.%d isratify.%d DPOW.%s statemachine checkpoint.%d %s start.%u+dur.%d vs %ld\n",bp->paxwdcrc,bp->myind,bp->isratify,src->symbol,checkpoint.blockhash.height,bits256_str(str,checkpoint.blockhash.hash),starttime,bp->duration,time(NULL)); + printf("PAXWDCRC.%x myind.%d isratify.%d DPOW.%s statemachine checkpoint.%d %s start.%u+dur.%d vs %ld MoM[%d] %s\n",bp->paxwdcrc,bp->myind,bp->isratify,src->symbol,checkpoint.blockhash.height,bits256_str(str,checkpoint.blockhash.hash),starttime,bp->duration,time(NULL),bp->MoMdepth,bits256_str(str2,bp->MoM)); for (i=0; iminerkey33[i+1]; //printf("start utxosync start.%u %u\n",starttime,(uint32_t)time(NULL)); From 785a3456778c768d812397f68b16b3722c02c565 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 28 Apr 2018 14:37:23 +0300 Subject: [PATCH 67/98] Test --- iguana/dpow/dpow_fsm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 674b92c9c..c9c0ace26 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -242,6 +242,7 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu if ( prevMoMheight == 0 ) prevMoMheight = 1; *MoMdepthp = (height - prevMoMheight); + printf("%s ht.%d prevMoM.%d -> depth %d\n",coin->symbol,height,prevMoMheight,*MoMdepthp); if ( *MoMdepthp > 1440*30 ) *MoMdepthp = 1440*30; if ( *MoMdepthp > 0 && (MoMjson= issue_calcMoM(coin,height,*MoMdepthp)) != 0 ) From 89a96f7c433621c88b99c2a861f6c983f46ee30b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 10:05:06 +0300 Subject: [PATCH 68/98] Restore LOCK cs_main in gettino --- iguana/dpow/dpow_fsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index c9c0ace26..28e893606 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -242,7 +242,7 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu if ( prevMoMheight == 0 ) prevMoMheight = 1; *MoMdepthp = (height - prevMoMheight); - printf("%s ht.%d prevMoM.%d -> depth %d\n",coin->symbol,height,prevMoMheight,*MoMdepthp); + //printf("%s ht.%d prevMoM.%d -> depth %d\n",coin->symbol,height,prevMoMheight,*MoMdepthp); if ( *MoMdepthp > 1440*30 ) *MoMdepthp = 1440*30; if ( *MoMdepthp > 0 && (MoMjson= issue_calcMoM(coin,height,*MoMdepthp)) != 0 ) From 2cfe7ee7d9e87e490d60fed9115f4540d783ec82 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 11:05:15 +0300 Subject: [PATCH 69/98] New elected --- iguana/elected | 84 ++++++++++++++++++++++++++++++++++++++++++++- iguana/elected.2017 | 1 + 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 iguana/elected.2017 diff --git a/iguana/elected b/iguana/elected index 9f9bfc7b1..270eb671a 100644 --- a/iguana/elected +++ b/iguana/elected @@ -1 +1,83 @@ -{"port":7775,"BTCminsigs":14,"minsigs":13,"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"],"notaries":[ { "0_jl777_testA":"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" }, { "0_jl777_testB":"02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344" }, { "0_kolo_testA":"0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec" }, { "artik_AR":"029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90" }, { "artik_EU":"03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce" }, { "artik_NA":"0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842" }, { "artik_SH":"02bdd8840a34486f38305f311c0e2ae73e84046f6e9c3dd3571e32e58339d20937" }, { "badass_EU":"0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" }, { "badass_NA":"02afa1a9f948e1634a29dc718d218e9d150c531cfa852843a1643a02184a63c1a7" }, { "badass_SH":"026b49dd3923b78a592c1b475f208e23698d3f085c4c3b4906a59faf659fd9530b" }, { "crackers_EU":"03bc819982d3c6feb801ec3b720425b017d9b6ee9a40746b84422cbbf929dc73c3" }, { "crackers_NA":"03205049103113d48c7c7af811b4c8f194dafc43a50d5313e61a22900fc1805b45" }, { "crackers_SH":"02be28310e6312d1dd44651fd96f6a44ccc269a321f907502aae81d246fabdb03e" }, { "durerus_EU":"02bcbd287670bdca2c31e5d50130adb5dea1b53198f18abeec7211825f47485d57" }, { "etszombi_AR":"031c79168d15edabf17d9ec99531ea9baa20039d0cdc14d9525863b83341b210e9" }, { "etszombi_EU":"0281b1ad28d238a2b217e0af123ce020b79e91b9b10ad65a7917216eda6fe64bf7" }, { "etszombi_SH":"025d7a193c0757f7437fad3431f027e7b5ed6c925b77daba52a8755d24bf682dde" }, { "farl4web_EU":"0300ecf9121cccf14cf9423e2adb5d98ce0c4e251721fa345dec2e03abeffbab3f" }, { "farl4web_SH":"0396bb5ed3c57aa1221d7775ae0ff751e4c7dc9be220d0917fa8bbdf670586c030" }, { "fullmoon_AR":"0254b1d64840ce9ff6bec9dd10e33beb92af5f7cee628f999cb6bc0fea833347cc" }, { "fullmoon_NA":"031fb362323b06e165231c887836a8faadb96eda88a79ca434e28b3520b47d235b" }, { "fullmoon_SH":"030e12b42ec33a80e12e570b6c8274ce664565b5c3da106859e96a7208b93afd0d" }, { "grewal_NA":"03adc0834c203d172bce814df7c7a5e13dc603105e6b0adabc942d0421aefd2132" }, { "grewal_SH":"03212a73f5d38a675ee3cdc6e82542a96c38c3d1c79d25a1ed2e42fcf6a8be4e68" }, { "indenodes_AR":"02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147" }, { "indenodes_EU":"0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, { "indenodes_NA":"02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988" }, { "indenodes_SH":"0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" }, { "jeezy_EU":"023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" }, { "jsgalt_NA":"027b3fb6fede798cd17c30dbfb7baf9332b3f8b1c7c513f443070874c410232446" }, { "karasugoi_NA":"02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" }, { "kashifali_EU":"033777c52a0190f261c6f66bd0e2bb299d30f012dcb8bfff384103211edb8bb207" }, { "kolo_AR":"03016d19344c45341e023b72f9fb6e6152fdcfe105f3b4f50b82a4790ff54e9dc6" }, { "kolo_SH":"02aa24064500756d9b0959b44d5325f2391d8e95c6127e109184937152c384e185" }, { "metaphilibert_AR":"02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6" }, { "movecrypto_AR":"022783d94518e4dc77cbdf1a97915b29f427d7bc15ea867900a76665d3112be6f3" }, { "movecrypto_EU":"021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" }, { "movecrypto_NA":"02efb12f4d78f44b0542d1c60146738e4d5506d27ec98a469142c5c84b29de0a80" }, { "movecrypto_SH":"031f9739a3ebd6037a967ce1582cde66e79ea9a0551c54731c59c6b80f635bc859" }, { "muros_AR":"022d77402fd7179335da39479c829be73428b0ef33fb360a4de6890f37c2aa005e" }, { "noashh_AR":"029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355" }, { "noashh_EU":"02061c6278b91fd4ac5cab4401100ffa3b2d5a277e8f71db23401cc071b3665546" }, { "noashh_NA":"033c073366152b6b01535e15dd966a3a8039169584d06e27d92a69889b720d44e1" }, { "nxtswe_EU":"032fb104e5eaa704a38a52c126af8f67e870d70f82977e5b2f093d5c1c21ae5899" }, { "polycryptoblog_NA":"02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622" }, { "pondsea_AR":"032e1c213787312099158f2d74a89e8240a991d162d4ce8017d8504d1d7004f735" }, { "pondsea_EU":"0225aa6f6f19e543180b31153d9e6d55d41bc7ec2ba191fd29f19a2f973544e29d" }, { "pondsea_NA":"031bcfdbb62268e2ff8dfffeb9ddff7fe95fca46778c77eebff9c3829dfa1bb411" }, { "pondsea_SH":"02209073bc0943451498de57f802650311b1f12aa6deffcd893da198a544c04f36" }, { "popcornbag_AR":"02761f106fb34fbfc5ddcc0c0aa831ed98e462a908550b280a1f7bd32c060c6fa3" }, { "popcornbag_NA":"03c6085c7fdfff70988fda9b197371f1caf8397f1729a844790e421ee07b3a93e8" }, { "ptytrader_NA":"0328c61467148b207400b23875234f8a825cce65b9c4c9b664f47410b8b8e3c222" }, { "ptytrader_SH":"0250c93c492d8d5a6b565b90c22bee07c2d8701d6118c6267e99a4efd3c7748fa4" }, { "rnr_AR":"029bdb08f931c0e98c2c4ba4ef45c8e33a34168cb2e6bf953cef335c359d77bfcd" }, { "rnr_EU":"03f5c08dadffa0ffcafb8dd7ffc38c22887bd02702a6c9ac3440deddcf2837692b" }, { "rnr_NA":"02e17c5f8c3c80f584ed343b8dcfa6d710dfef0889ec1e7728ce45ce559347c58c" }, { "rnr_SH":"037536fb9bdfed10251f71543fb42679e7c52308bcd12146b2568b9a818d8b8377" }, { "titomane_AR":"03cda6ca5c2d02db201488a54a548dbfc10533bdc275d5ea11928e8d6ab33c2185" }, { "titomane_EU":"02e41feded94f0cc59f55f82f3c2c005d41da024e9a805b41105207ef89aa4bfbd" }, { "titomane_SH":"035f49d7a308dd9a209e894321f010d21b7793461b0c89d6d9231a3fe5f68d9960" }, { "vanbreuk_EU":"024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3" }, { "xrobesx_NA":"03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" }, { "xxspot1_XX":"02ef445a392fcaf3ad4176a5da7f43580e8056594e003eba6559a713711a27f955" }, { "xxspot2_XX":"03d85b221ea72ebcd25373e7961f4983d12add66a92f899deaf07bab1d8b6f5573" }]} +{ +"port": 7775, +"BTCminsigs": 14, +"minsigs": 13, +"seeds": [ + "95.213.205.222", + "167.114.208.203", + "139.99.122.140", + "104.255.168.213", + "138.121.203.226", + "167.99.69.47", + "139.99.144.122", + "77.95.229.63", + "37.9.62.186", + "145.239.204.33", + "74.208.210.191" +], +"notaries": [ + {"dev1_jl777": "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" }, + {"dev2_kolo": "030f34af4b908fb8eb2099accb56b8d157d49f6cfb691baa80fdd34f385efed961" }, + {"dev3_kolo": "025af9d2b2a05338478159e9ac84543968fd18c45fd9307866b56f33898653b014" }, + {"dev4_decker": "028eea44a09674dda00d88ffd199a09c9b75ba9782382cc8f1e97c0fd565fe5707" }, + {"a-team_SH": "03b59ad322b17cb94080dc8e6dc10a0a865de6d47c16fb5b1a0b5f77f9507f3cce" }, + {"artik_AR": "029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90" }, + {"artik_EU": "03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce" }, + {"artik_NA": "0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842" }, + {"artik_SH": "02bdd8840a34486f38305f311c0e2ae73e84046f6e9c3dd3571e32e58339d20937" }, + {"badass_EU": "0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" }, + {"badass_NA": "02afa1a9f948e1634a29dc718d218e9d150c531cfa852843a1643a02184a63c1a7" }, + {"batman_AR": "033ecb640ec5852f42be24c3bf33ca123fb32ced134bed6aa2ba249cf31b0f2563" }, + {"batman_SH": "02ca5898931181d0b8aafc75ef56fce9c43656c0b6c9f64306e7c8542f6207018c" }, + {"ca333_EU": "03fc87b8c804f12a6bd18efd43b0ba2828e4e38834f6b44c0bfee19f966a12ba99" }, + {"chainmakers_EU": "02f3b08938a7f8d2609d567aebc4989eeded6e2e880c058fdf092c5da82c3bc5ee" }, + {"chainmakers_NA": "0276c6d1c65abc64c8559710b8aff4b9e33787072d3dda4ec9a47b30da0725f57a" }, + {"chainstrike_SH": "0370bcf10575d8fb0291afad7bf3a76929734f888228bc49e35c5c49b336002153" }, + {"cipi_AR": "02c4f89a5b382750836cb787880d30e23502265054e1c327a5bfce67116d757ce8" }, + {"cipi_NA": "02858904a2a1a0b44df4c937b65ee1f5b66186ab87a751858cf270dee1d5031f18" }, + {"crackers_EU": "03bc819982d3c6feb801ec3b720425b017d9b6ee9a40746b84422cbbf929dc73c3" }, + {"crackers_NA": "03205049103113d48c7c7af811b4c8f194dafc43a50d5313e61a22900fc1805b45" }, + {"dwy_EU": "0259c646288580221fdf0e92dbeecaee214504fdc8bbdf4a3019d6ec18b7540424" }, + {"emmanux_SH": "033f316114d950497fc1d9348f03770cd420f14f662ab2db6172df44c389a2667a" }, + {"etszombi_EU": "0281b1ad28d238a2b217e0af123ce020b79e91b9b10ad65a7917216eda6fe64bf7" }, + {"fullmoon_AR": "03380314c4f42fa854df8c471618751879f9e8f0ff5dbabda2bd77d0f96cb35676" }, + {"fullmoon_NA": "030216211d8e2a48bae9e5d7eb3a42ca2b7aae8770979a791f883869aea2fa6eef" }, + {"fullmoon_SH": "03f34282fa57ecc7aba8afaf66c30099b5601e98dcbfd0d8a58c86c20d8b692c64" }, + {"goldenman_EU": "02d6f13a8f745921cdb811e32237bb98950af1a5952be7b3d429abd9152f8e388d" }, + {"indenodes_AR": "02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147" }, + {"indenodes_EU": "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, + {"indenodes_NA": "02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988" }, + {"indenodes_SH": "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" }, + {"jackson_AR": "038ff7cfe34cb13b524e0941d5cf710beca2ffb7e05ddf15ced7d4f14fbb0a6f69" }, + {"jeezy_EU": "023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" }, + {"karasugoi_NA": "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" }, + {"komodoninja_EU": "038e567b99806b200b267b27bbca2abf6a3e8576406df5f872e3b38d30843cd5ba" }, + {"komodoninja_SH": "033178586896915e8456ebf407b1915351a617f46984001790f0cce3d6f3ada5c2" }, + {"komodopioneers_SH": "033ace50aedf8df70035b962a805431363a61cc4e69d99d90726a2d48fb195f68c" }, + {"libscott_SH": "03301a8248d41bc5dc926088a8cf31b65e2daf49eed7eb26af4fb03aae19682b95" }, + {"lukechilds_AR": "031aa66313ee024bbee8c17915cf7d105656d0ace5b4a43a3ab5eae1e14ec02696" }, + {"madmax_AR": "03891555b4a4393d655bf76f0ad0fb74e5159a615b6925907678edc2aac5e06a75" }, + {"meshbits_AR": "02957fd48ae6cb361b8a28cdb1b8ccf5067ff68eb1f90cba7df5f7934ed8eb4b2c" }, + {"meshbits_SH": "025c6e94877515dfd7b05682b9cc2fe4a49e076efe291e54fcec3add78183c1edb" }, + {"metaphilibert_AR": "02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6" }, + {"metaphilibert_SH": "0284af1a5ef01503e6316a2ca4abf8423a794e9fc17ac6846f042b6f4adedc3309" }, + {"patchkez_SH": "0296270f394140640f8fa15684fc11255371abb6b9f253416ea2734e34607799c4" }, + {"pbca26_NA": "0276aca53a058556c485bbb60bdc54b600efe402a8b97f0341a7c04803ce204cb5" }, + {"peer2cloud_AR": "034e5563cb885999ae1530bd66fab728e580016629e8377579493b386bf6cebb15" }, + {"peer2cloud_SH": "03396ac453b3f23e20f30d4793c5b8ab6ded6993242df4f09fd91eb9a4f8aede84" }, + {"polycryptoblog_NA": "02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622" }, + {"hyper_AR": "020f2f984d522051bd5247b61b080b4374a7ab389d959408313e8062acad3266b4" }, + {"hyper_EU": "03d00cf9ceace209c59fb013e112a786ad583d7de5ca45b1e0df3b4023bb14bf51" }, + {"hyper_SH": "0383d0b37f59f4ee5e3e98a47e461c861d49d0d90c80e9e16f7e63686a2dc071f3" }, + {"hyper_NA": "03d91c43230336c0d4b769c9c940145a8c53168bf62e34d1bccd7f6cfc7e5592de" }, + {"popcornbag_AR": "02761f106fb34fbfc5ddcc0c0aa831ed98e462a908550b280a1f7bd32c060c6fa3" }, + {"popcornbag_NA": "03c6085c7fdfff70988fda9b197371f1caf8397f1729a844790e421ee07b3a93e8" }, + {"alien_AR": "0348d9b1fc6acf81290405580f525ee49b4749ed4637b51a28b18caa26543b20f0" }, + {"alien_EU": "020aab8308d4df375a846a9e3b1c7e99597b90497efa021d50bcf1bbba23246527" }, + {"thegaltmines_NA": "031bea28bec98b6380958a493a703ddc3353d7b05eb452109a773eefd15a32e421" }, + {"titomane_AR": "029d19215440d8cb9cc6c6b7a4744ae7fb9fb18d986e371b06aeb34b64845f9325" }, + {"titomane_EU": "0360b4805d885ff596f94312eed3e4e17cb56aa8077c6dd78d905f8de89da9499f" }, + {"titomane_SH": "03573713c5b20c1e682a2e8c0f8437625b3530f278e705af9b6614de29277a435b" }, + {"webworker01_NA": "03bb7d005e052779b1586f071834c5facbb83470094cff5112f0072b64989f97d7" }, + {"xrobesx_NA": "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" } +]} diff --git a/iguana/elected.2017 b/iguana/elected.2017 new file mode 100644 index 000000000..9f9bfc7b1 --- /dev/null +++ b/iguana/elected.2017 @@ -0,0 +1 @@ +{"port":7775,"BTCminsigs":14,"minsigs":13,"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"],"notaries":[ { "0_jl777_testA":"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" }, { "0_jl777_testB":"02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344" }, { "0_kolo_testA":"0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec" }, { "artik_AR":"029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90" }, { "artik_EU":"03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce" }, { "artik_NA":"0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842" }, { "artik_SH":"02bdd8840a34486f38305f311c0e2ae73e84046f6e9c3dd3571e32e58339d20937" }, { "badass_EU":"0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" }, { "badass_NA":"02afa1a9f948e1634a29dc718d218e9d150c531cfa852843a1643a02184a63c1a7" }, { "badass_SH":"026b49dd3923b78a592c1b475f208e23698d3f085c4c3b4906a59faf659fd9530b" }, { "crackers_EU":"03bc819982d3c6feb801ec3b720425b017d9b6ee9a40746b84422cbbf929dc73c3" }, { "crackers_NA":"03205049103113d48c7c7af811b4c8f194dafc43a50d5313e61a22900fc1805b45" }, { "crackers_SH":"02be28310e6312d1dd44651fd96f6a44ccc269a321f907502aae81d246fabdb03e" }, { "durerus_EU":"02bcbd287670bdca2c31e5d50130adb5dea1b53198f18abeec7211825f47485d57" }, { "etszombi_AR":"031c79168d15edabf17d9ec99531ea9baa20039d0cdc14d9525863b83341b210e9" }, { "etszombi_EU":"0281b1ad28d238a2b217e0af123ce020b79e91b9b10ad65a7917216eda6fe64bf7" }, { "etszombi_SH":"025d7a193c0757f7437fad3431f027e7b5ed6c925b77daba52a8755d24bf682dde" }, { "farl4web_EU":"0300ecf9121cccf14cf9423e2adb5d98ce0c4e251721fa345dec2e03abeffbab3f" }, { "farl4web_SH":"0396bb5ed3c57aa1221d7775ae0ff751e4c7dc9be220d0917fa8bbdf670586c030" }, { "fullmoon_AR":"0254b1d64840ce9ff6bec9dd10e33beb92af5f7cee628f999cb6bc0fea833347cc" }, { "fullmoon_NA":"031fb362323b06e165231c887836a8faadb96eda88a79ca434e28b3520b47d235b" }, { "fullmoon_SH":"030e12b42ec33a80e12e570b6c8274ce664565b5c3da106859e96a7208b93afd0d" }, { "grewal_NA":"03adc0834c203d172bce814df7c7a5e13dc603105e6b0adabc942d0421aefd2132" }, { "grewal_SH":"03212a73f5d38a675ee3cdc6e82542a96c38c3d1c79d25a1ed2e42fcf6a8be4e68" }, { "indenodes_AR":"02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147" }, { "indenodes_EU":"0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, { "indenodes_NA":"02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988" }, { "indenodes_SH":"0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" }, { "jeezy_EU":"023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" }, { "jsgalt_NA":"027b3fb6fede798cd17c30dbfb7baf9332b3f8b1c7c513f443070874c410232446" }, { "karasugoi_NA":"02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" }, { "kashifali_EU":"033777c52a0190f261c6f66bd0e2bb299d30f012dcb8bfff384103211edb8bb207" }, { "kolo_AR":"03016d19344c45341e023b72f9fb6e6152fdcfe105f3b4f50b82a4790ff54e9dc6" }, { "kolo_SH":"02aa24064500756d9b0959b44d5325f2391d8e95c6127e109184937152c384e185" }, { "metaphilibert_AR":"02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6" }, { "movecrypto_AR":"022783d94518e4dc77cbdf1a97915b29f427d7bc15ea867900a76665d3112be6f3" }, { "movecrypto_EU":"021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" }, { "movecrypto_NA":"02efb12f4d78f44b0542d1c60146738e4d5506d27ec98a469142c5c84b29de0a80" }, { "movecrypto_SH":"031f9739a3ebd6037a967ce1582cde66e79ea9a0551c54731c59c6b80f635bc859" }, { "muros_AR":"022d77402fd7179335da39479c829be73428b0ef33fb360a4de6890f37c2aa005e" }, { "noashh_AR":"029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355" }, { "noashh_EU":"02061c6278b91fd4ac5cab4401100ffa3b2d5a277e8f71db23401cc071b3665546" }, { "noashh_NA":"033c073366152b6b01535e15dd966a3a8039169584d06e27d92a69889b720d44e1" }, { "nxtswe_EU":"032fb104e5eaa704a38a52c126af8f67e870d70f82977e5b2f093d5c1c21ae5899" }, { "polycryptoblog_NA":"02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622" }, { "pondsea_AR":"032e1c213787312099158f2d74a89e8240a991d162d4ce8017d8504d1d7004f735" }, { "pondsea_EU":"0225aa6f6f19e543180b31153d9e6d55d41bc7ec2ba191fd29f19a2f973544e29d" }, { "pondsea_NA":"031bcfdbb62268e2ff8dfffeb9ddff7fe95fca46778c77eebff9c3829dfa1bb411" }, { "pondsea_SH":"02209073bc0943451498de57f802650311b1f12aa6deffcd893da198a544c04f36" }, { "popcornbag_AR":"02761f106fb34fbfc5ddcc0c0aa831ed98e462a908550b280a1f7bd32c060c6fa3" }, { "popcornbag_NA":"03c6085c7fdfff70988fda9b197371f1caf8397f1729a844790e421ee07b3a93e8" }, { "ptytrader_NA":"0328c61467148b207400b23875234f8a825cce65b9c4c9b664f47410b8b8e3c222" }, { "ptytrader_SH":"0250c93c492d8d5a6b565b90c22bee07c2d8701d6118c6267e99a4efd3c7748fa4" }, { "rnr_AR":"029bdb08f931c0e98c2c4ba4ef45c8e33a34168cb2e6bf953cef335c359d77bfcd" }, { "rnr_EU":"03f5c08dadffa0ffcafb8dd7ffc38c22887bd02702a6c9ac3440deddcf2837692b" }, { "rnr_NA":"02e17c5f8c3c80f584ed343b8dcfa6d710dfef0889ec1e7728ce45ce559347c58c" }, { "rnr_SH":"037536fb9bdfed10251f71543fb42679e7c52308bcd12146b2568b9a818d8b8377" }, { "titomane_AR":"03cda6ca5c2d02db201488a54a548dbfc10533bdc275d5ea11928e8d6ab33c2185" }, { "titomane_EU":"02e41feded94f0cc59f55f82f3c2c005d41da024e9a805b41105207ef89aa4bfbd" }, { "titomane_SH":"035f49d7a308dd9a209e894321f010d21b7793461b0c89d6d9231a3fe5f68d9960" }, { "vanbreuk_EU":"024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3" }, { "xrobesx_NA":"03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" }, { "xxspot1_XX":"02ef445a392fcaf3ad4176a5da7f43580e8056594e003eba6559a713711a27f955" }, { "xxspot2_XX":"03d85b221ea72ebcd25373e7961f4983d12add66a92f899deaf07bab1d8b6f5573" }]} From 9e6eb24f983cb5c0f984c4265c63fe629a217ab1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 11:12:16 +0300 Subject: [PATCH 70/98] Test --- iguana/elected | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/elected b/iguana/elected index 270eb671a..a84e9aaed 100644 --- a/iguana/elected +++ b/iguana/elected @@ -7,6 +7,7 @@ "167.114.208.203", "139.99.122.140", "104.255.168.213", + "78.47.196.146", "138.121.203.226", "167.99.69.47", "139.99.144.122", From 0d471900ab40482afcf77836cb1044eb4cc4b65f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 11:21:07 +0300 Subject: [PATCH 71/98] -seeds[] --- iguana/dpow/dpow_rpc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index c9f47ce4d..4abaf1506 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -72,16 +72,18 @@ cJSON *dpow_getinfo(struct supernet_info *myinfo,struct iguana_info *coin) } char *Notaries_elected[65][2]; -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" }; -int32_t Notaries_numseeds = (int32_t)(sizeof(seeds)/sizeof(*seeds)),Notaries_num,Notaries_BTCminsigs = DPOW_MINSIGS,Notaries_minsigs = DPOW_MIN_ASSETCHAIN_SIGS; +//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" }; +int32_t Notaries_numseeds;// = (int32_t)(sizeof(seeds)/sizeof(*seeds)) +int32_t Notaries_num,Notaries_BTCminsigs = DPOW_MINSIGS; +int32_t Notaries_minsigs = DPOW_MIN_ASSETCHAIN_SIGS; uint16_t Notaries_port = DPOW_SOCKPORT; char *Notaries_seeds[65]; int32_t komodo_initjson(char *fname) { char *fstr,*field,*hexstr; cJSON *argjson,*array,*item; long fsize; uint16_t port; int32_t i,n,num,retval = -1; - for (i=0; i Date: Sun, 29 Apr 2018 11:24:39 +0300 Subject: [PATCH 72/98] Fix --- iguana/dpow/dpow_rpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 4abaf1506..40826d7d0 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -101,6 +101,7 @@ int32_t komodo_initjson(char *fname) Notaries_seeds[i] = clonestr(jstri(array,i)); printf("%s ",Notaries_seeds[i]); } + Notaries_numseeds = i; printf("Notaries_numseeds.%d\n",Notaries_numseeds); } if ( (array= jarray(&n,argjson,"notaries")) != 0 && n <= 64 ) From bdf3c978f825d7c0e1eb14a1f158cdf25d52ff38 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 11:39:56 +0300 Subject: [PATCH 73/98] Abort if not on official notary list --- iguana/dpow/dpow_fsm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 28e893606..daa713253 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -420,6 +420,7 @@ void dpow_statemachinestart(void *ptr) printf(" statemachinestart this node %s %s is not official notary numnotaries.%d kmdht.%d bpht.%d\n",srcaddr,destaddr,bp->numnotaries,kmdheight,bp->height); free(ptr); dp->ratifying -= bp->isratify; + exit(-1); return; } printf("myind.%d\n",myind); From e4d47f2b000531fc85b06c76f48d1b29cb27cfd2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 12:45:40 +0300 Subject: [PATCH 74/98] Test single seed node --- iguana/elected | 11 ------ iguana/elected.new | 84 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 11 deletions(-) create mode 100644 iguana/elected.new diff --git a/iguana/elected b/iguana/elected index a84e9aaed..bd400cd68 100644 --- a/iguana/elected +++ b/iguana/elected @@ -3,18 +3,7 @@ "BTCminsigs": 14, "minsigs": 13, "seeds": [ - "95.213.205.222", - "167.114.208.203", - "139.99.122.140", - "104.255.168.213", "78.47.196.146", - "138.121.203.226", - "167.99.69.47", - "139.99.144.122", - "77.95.229.63", - "37.9.62.186", - "145.239.204.33", - "74.208.210.191" ], "notaries": [ {"dev1_jl777": "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" }, diff --git a/iguana/elected.new b/iguana/elected.new new file mode 100644 index 000000000..a84e9aaed --- /dev/null +++ b/iguana/elected.new @@ -0,0 +1,84 @@ +{ +"port": 7775, +"BTCminsigs": 14, +"minsigs": 13, +"seeds": [ + "95.213.205.222", + "167.114.208.203", + "139.99.122.140", + "104.255.168.213", + "78.47.196.146", + "138.121.203.226", + "167.99.69.47", + "139.99.144.122", + "77.95.229.63", + "37.9.62.186", + "145.239.204.33", + "74.208.210.191" +], +"notaries": [ + {"dev1_jl777": "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" }, + {"dev2_kolo": "030f34af4b908fb8eb2099accb56b8d157d49f6cfb691baa80fdd34f385efed961" }, + {"dev3_kolo": "025af9d2b2a05338478159e9ac84543968fd18c45fd9307866b56f33898653b014" }, + {"dev4_decker": "028eea44a09674dda00d88ffd199a09c9b75ba9782382cc8f1e97c0fd565fe5707" }, + {"a-team_SH": "03b59ad322b17cb94080dc8e6dc10a0a865de6d47c16fb5b1a0b5f77f9507f3cce" }, + {"artik_AR": "029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90" }, + {"artik_EU": "03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce" }, + {"artik_NA": "0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842" }, + {"artik_SH": "02bdd8840a34486f38305f311c0e2ae73e84046f6e9c3dd3571e32e58339d20937" }, + {"badass_EU": "0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" }, + {"badass_NA": "02afa1a9f948e1634a29dc718d218e9d150c531cfa852843a1643a02184a63c1a7" }, + {"batman_AR": "033ecb640ec5852f42be24c3bf33ca123fb32ced134bed6aa2ba249cf31b0f2563" }, + {"batman_SH": "02ca5898931181d0b8aafc75ef56fce9c43656c0b6c9f64306e7c8542f6207018c" }, + {"ca333_EU": "03fc87b8c804f12a6bd18efd43b0ba2828e4e38834f6b44c0bfee19f966a12ba99" }, + {"chainmakers_EU": "02f3b08938a7f8d2609d567aebc4989eeded6e2e880c058fdf092c5da82c3bc5ee" }, + {"chainmakers_NA": "0276c6d1c65abc64c8559710b8aff4b9e33787072d3dda4ec9a47b30da0725f57a" }, + {"chainstrike_SH": "0370bcf10575d8fb0291afad7bf3a76929734f888228bc49e35c5c49b336002153" }, + {"cipi_AR": "02c4f89a5b382750836cb787880d30e23502265054e1c327a5bfce67116d757ce8" }, + {"cipi_NA": "02858904a2a1a0b44df4c937b65ee1f5b66186ab87a751858cf270dee1d5031f18" }, + {"crackers_EU": "03bc819982d3c6feb801ec3b720425b017d9b6ee9a40746b84422cbbf929dc73c3" }, + {"crackers_NA": "03205049103113d48c7c7af811b4c8f194dafc43a50d5313e61a22900fc1805b45" }, + {"dwy_EU": "0259c646288580221fdf0e92dbeecaee214504fdc8bbdf4a3019d6ec18b7540424" }, + {"emmanux_SH": "033f316114d950497fc1d9348f03770cd420f14f662ab2db6172df44c389a2667a" }, + {"etszombi_EU": "0281b1ad28d238a2b217e0af123ce020b79e91b9b10ad65a7917216eda6fe64bf7" }, + {"fullmoon_AR": "03380314c4f42fa854df8c471618751879f9e8f0ff5dbabda2bd77d0f96cb35676" }, + {"fullmoon_NA": "030216211d8e2a48bae9e5d7eb3a42ca2b7aae8770979a791f883869aea2fa6eef" }, + {"fullmoon_SH": "03f34282fa57ecc7aba8afaf66c30099b5601e98dcbfd0d8a58c86c20d8b692c64" }, + {"goldenman_EU": "02d6f13a8f745921cdb811e32237bb98950af1a5952be7b3d429abd9152f8e388d" }, + {"indenodes_AR": "02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147" }, + {"indenodes_EU": "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, + {"indenodes_NA": "02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988" }, + {"indenodes_SH": "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" }, + {"jackson_AR": "038ff7cfe34cb13b524e0941d5cf710beca2ffb7e05ddf15ced7d4f14fbb0a6f69" }, + {"jeezy_EU": "023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" }, + {"karasugoi_NA": "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" }, + {"komodoninja_EU": "038e567b99806b200b267b27bbca2abf6a3e8576406df5f872e3b38d30843cd5ba" }, + {"komodoninja_SH": "033178586896915e8456ebf407b1915351a617f46984001790f0cce3d6f3ada5c2" }, + {"komodopioneers_SH": "033ace50aedf8df70035b962a805431363a61cc4e69d99d90726a2d48fb195f68c" }, + {"libscott_SH": "03301a8248d41bc5dc926088a8cf31b65e2daf49eed7eb26af4fb03aae19682b95" }, + {"lukechilds_AR": "031aa66313ee024bbee8c17915cf7d105656d0ace5b4a43a3ab5eae1e14ec02696" }, + {"madmax_AR": "03891555b4a4393d655bf76f0ad0fb74e5159a615b6925907678edc2aac5e06a75" }, + {"meshbits_AR": "02957fd48ae6cb361b8a28cdb1b8ccf5067ff68eb1f90cba7df5f7934ed8eb4b2c" }, + {"meshbits_SH": "025c6e94877515dfd7b05682b9cc2fe4a49e076efe291e54fcec3add78183c1edb" }, + {"metaphilibert_AR": "02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6" }, + {"metaphilibert_SH": "0284af1a5ef01503e6316a2ca4abf8423a794e9fc17ac6846f042b6f4adedc3309" }, + {"patchkez_SH": "0296270f394140640f8fa15684fc11255371abb6b9f253416ea2734e34607799c4" }, + {"pbca26_NA": "0276aca53a058556c485bbb60bdc54b600efe402a8b97f0341a7c04803ce204cb5" }, + {"peer2cloud_AR": "034e5563cb885999ae1530bd66fab728e580016629e8377579493b386bf6cebb15" }, + {"peer2cloud_SH": "03396ac453b3f23e20f30d4793c5b8ab6ded6993242df4f09fd91eb9a4f8aede84" }, + {"polycryptoblog_NA": "02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622" }, + {"hyper_AR": "020f2f984d522051bd5247b61b080b4374a7ab389d959408313e8062acad3266b4" }, + {"hyper_EU": "03d00cf9ceace209c59fb013e112a786ad583d7de5ca45b1e0df3b4023bb14bf51" }, + {"hyper_SH": "0383d0b37f59f4ee5e3e98a47e461c861d49d0d90c80e9e16f7e63686a2dc071f3" }, + {"hyper_NA": "03d91c43230336c0d4b769c9c940145a8c53168bf62e34d1bccd7f6cfc7e5592de" }, + {"popcornbag_AR": "02761f106fb34fbfc5ddcc0c0aa831ed98e462a908550b280a1f7bd32c060c6fa3" }, + {"popcornbag_NA": "03c6085c7fdfff70988fda9b197371f1caf8397f1729a844790e421ee07b3a93e8" }, + {"alien_AR": "0348d9b1fc6acf81290405580f525ee49b4749ed4637b51a28b18caa26543b20f0" }, + {"alien_EU": "020aab8308d4df375a846a9e3b1c7e99597b90497efa021d50bcf1bbba23246527" }, + {"thegaltmines_NA": "031bea28bec98b6380958a493a703ddc3353d7b05eb452109a773eefd15a32e421" }, + {"titomane_AR": "029d19215440d8cb9cc6c6b7a4744ae7fb9fb18d986e371b06aeb34b64845f9325" }, + {"titomane_EU": "0360b4805d885ff596f94312eed3e4e17cb56aa8077c6dd78d905f8de89da9499f" }, + {"titomane_SH": "03573713c5b20c1e682a2e8c0f8437625b3530f278e705af9b6614de29277a435b" }, + {"webworker01_NA": "03bb7d005e052779b1586f071834c5facbb83470094cff5112f0072b64989f97d7" }, + {"xrobesx_NA": "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" } +]} From 84219ece4a9d246aea226fa9c9e1b649aa0f7682 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 12:48:12 +0300 Subject: [PATCH 75/98] Fix --- iguana/elected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/elected b/iguana/elected index bd400cd68..9d9bca65f 100644 --- a/iguana/elected +++ b/iguana/elected @@ -3,7 +3,7 @@ "BTCminsigs": 14, "minsigs": 13, "seeds": [ - "78.47.196.146", + "78.47.196.146" ], "notaries": [ {"dev1_jl777": "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" }, From 146be3b2ffd51fb62fae2dc02589d5e828e06761 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 12:51:01 +0300 Subject: [PATCH 76/98] Test --- iguana/elected | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/elected b/iguana/elected index 9d9bca65f..139d0f242 100644 --- a/iguana/elected +++ b/iguana/elected @@ -3,6 +3,9 @@ "BTCminsigs": 14, "minsigs": 13, "seeds": [ + "78.47.196.146", + "78.47.196.146", + "78.47.196.146", "78.47.196.146" ], "notaries": [ From 62017db5736532b33fba62a3faff010eba946764 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 12:55:33 +0300 Subject: [PATCH 77/98] -addnotarys_7776 --- iguana/m_notary_run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/m_notary_run b/iguana/m_notary_run index a36cbfa04..c2ac884cf 100755 --- a/iguana/m_notary_run +++ b/iguana/m_notary_run @@ -16,7 +16,7 @@ source pubkey.txt sleep 4 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\"myipaddr\",\"ipaddr\":\"$myip\"}" sleep 3 -tests/addnotarys_7776 +#tests/addnotarys_7776 coins/btc_7776 #coins/ltc_7776 coins/kmd_7776 From aaa1ccbcbae2c973971de37d1f7e8c85c4fb11d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 13:04:51 +0300 Subject: [PATCH 78/98] Test --- iguana/m_notary_run | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/m_notary_run b/iguana/m_notary_run index c2ac884cf..ff82686f5 100755 --- a/iguana/m_notary_run +++ b/iguana/m_notary_run @@ -16,6 +16,7 @@ source pubkey.txt sleep 4 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\"myipaddr\",\"ipaddr\":\"$myip\"}" sleep 3 +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"78.47.196.146\"}" #tests/addnotarys_7776 coins/btc_7776 #coins/ltc_7776 From 3b883e051ab3b4e4ead9736f642c147721d259d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 14:18:28 +0300 Subject: [PATCH 79/98] 7775 -> 17775 --- iguana/elected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/elected b/iguana/elected index 139d0f242..92dfd0104 100644 --- a/iguana/elected +++ b/iguana/elected @@ -1,5 +1,5 @@ { -"port": 7775, +"port": 17775, "BTCminsigs": 14, "minsigs": 13, "seeds": [ From 7d3f70c80f8f64853ce34a303b031ed1ba6dadc5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 14:31:23 +0300 Subject: [PATCH 80/98] Splitfunds -> 0.0001 --- iguana/exchanges/splitfunds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/splitfunds b/iguana/exchanges/splitfunds index ac9a285af..614ee9429 100644 --- a/iguana/exchanges/splitfunds +++ b/iguana/exchanges/splitfunds @@ -2,5 +2,5 @@ source userpass export address=RGPido1EWcPWngDfkAcn4M4HXYt8avR4vs export script=2103f82c8c363d23076420a39904f9616d59c26a3d8dc7c51f67d8d3a94335431970ac -curl --url "http://127.0.0.1:7783" --data "{\"broadcast\":1,\"userpass\":\"$userpass\",\"method\":\"withdraw\",\"coin\":\"$1\",\"outputs\":[{\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"$address\":0.0005,\"script\":\"$script\"}, {\"RGPido1EWcPWngDfkAcn4M4HXYt8avR4vs\":0.0001}]}" +curl --url "http://127.0.0.1:7783" --data "{\"broadcast\":1,\"userpass\":\"$userpass\",\"method\":\"withdraw\",\"coin\":\"$1\",\"outputs\":[{\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001,\"script\":\"$script\"}, {\"$address\":0.0001}]}" From ecaff234f503bc183723632bb068595214606252 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 15:08:43 +0300 Subject: [PATCH 81/98] Online seeds --- iguana/elected | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/elected b/iguana/elected index 92dfd0104..58dbdb74e 100644 --- a/iguana/elected +++ b/iguana/elected @@ -3,10 +3,13 @@ "BTCminsigs": 14, "minsigs": 13, "seeds": [ - "78.47.196.146", - "78.47.196.146", - "78.47.196.146", - "78.47.196.146" + "78.47.196.146", + "37.9.62.186", + "145.239.204.33", + "185.169.229.64", + "163.172.100.144", + "149.56.240.91", + "139.99.144.54" ], "notaries": [ {"dev1_jl777": "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828" }, From a8e69f0a7fa1fda94eb1077894090761bc1bd8af Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 15:11:28 +0300 Subject: [PATCH 82/98] More seeds --- iguana/elected | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/elected b/iguana/elected index 58dbdb74e..60f3cecb6 100644 --- a/iguana/elected +++ b/iguana/elected @@ -8,6 +8,9 @@ "145.239.204.33", "185.169.229.64", "163.172.100.144", + "139.60.161.30", + "209.58.190.117", + "209.58.144.205", "149.56.240.91", "139.99.144.54" ], From 0d9dd937dd96d707c31735533219700048e9997b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 29 Apr 2018 15:23:49 +0300 Subject: [PATCH 83/98] Ignore manychains --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5cb2be3fe..3ae3a23ab 100755 --- a/.gitignore +++ b/.gitignore @@ -262,3 +262,5 @@ Release/* build_win64_release/* DB/* + +iguana/exchanges/manychains From 98353d32e83aaa611fb7d7e6d67c04f185ae5aed Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:32:48 +0300 Subject: [PATCH 84/98] Auto change validate address to getaddressinfo --- iguana/dpow/dpow_rpc.c | 2 +- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_rpc.c | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 40826d7d0..a436abc00 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -1167,7 +1167,7 @@ void dpow_issuer_voutupdate(struct dpow_info *dp,char *symbol,int32_t isspecial, if ( script[offset] == 'W' && strcmp(dp->symbol,"KMD") != 0 ) { // if valid add to pricefeed for issue - printf("WITHDRAW ht.%d txi.%d vout.%d %.8f opretlen.%d\n",height,txi,vout,dstr(fiatoshis),opretlen); + printf("notary vout.%s ht.%d txi.%d vout.%d %.8f opretlen.%d\n",symbol,height,txi,vout,dstr(fiatoshis),opretlen); if ( opretlen == 38 ) // any KMD tx { offset++; diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 632c344bd..dfb696e97 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -306,7 +306,7 @@ struct iguana_info int32_t numutxos,notarized,longestchain,firstrefht,firstscanht,lastscanht,height; uint16_t busport,did_addrutxo_reset; uint32_t txversion,dPoWtime,lastautosplit,lastresetutxo,loadedcache,electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; - char symbol[128],smartaddr[64],userpass[1024],serverport[128],instantdex_address[64],estimatefeestr[32],getinfostr[32],etomic[64]; + char symbol[128],smartaddr[64],userpass[1024],serverport[128],instantdex_address[64],estimatefeestr[32],getinfostr[32],etomic[64],validateaddress[64]; // portfolio double price_kmd,force,perc,goal,goalperc,relvolume,rate; void *electrum; void *ctx; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 93a2b75e1..41b24d580 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); - if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) + if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getaddressinfo") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) { if ( coin->electrum == 0 ) { @@ -344,7 +344,17 @@ cJSON *LP_validateaddress(char *symbol,char *address) else { sprintf(buf,"[\"%s\"]",address); - return(bitcoin_json(coin,"validateaddress",buf)); + if ( (retjson= bitcoin_json(coin,coin->validateaddress,buf)) != 0 ) + { + if ( jobj(retjson,"ismine") == 0 && strcmp(coin->validateaddress,"validateaddress") == 0 ) + { + printf("autochange validateaddress -> getaddressinfo\n",coin->symbol); + strcpy(coin->validateaddress,"getaddressinfo"); + free(retjson); + return(bitcoin_json(coin,coin->validateaddress,buf)); + } + } + return(retjson); } } From 5626f74f0ecb3904da8eeab1d80cc9a103f8be96 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:35:23 +0300 Subject: [PATCH 85/98] Syntax --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 41b24d580..c848225db 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -348,7 +348,7 @@ cJSON *LP_validateaddress(char *symbol,char *address) { if ( jobj(retjson,"ismine") == 0 && strcmp(coin->validateaddress,"validateaddress") == 0 ) { - printf("autochange validateaddress -> getaddressinfo\n",coin->symbol); + printf("autochange %s validateaddress -> getaddressinfo\n",coin->symbol); strcpy(coin->validateaddress,"getaddressinfo"); free(retjson); return(bitcoin_json(coin,coin->validateaddress,buf)); From 4618855b8602bf81d48c10cc8ba0e58f8695d3b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:37:11 +0300 Subject: [PATCH 86/98] Retry initial impogrtaddress to avoid timing issue --- iguana/exchanges/LP_rpc.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c848225db..2c7763930 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -649,7 +649,7 @@ int32_t LP_importaddress(char *symbol,char *address) cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) { static void *ctx; - char buf[512],address[64]; cJSON *retjson; struct iguana_info *coin; int32_t doneflag = 0; + char buf[512],address[64]; cJSON *retjson; struct iguana_info *coin; int32_t i,doneflag = 0; if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); @@ -663,9 +663,16 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) #ifdef LP_DONT_IMPORTPRIVKEY if ( LP_importaddress(symbol,address) < 0 ) { - printf("%s importaddress %s from %s failed, isvalid.%d\n",symbol,address,wifstr,bitcoin_validaddress(symbol,coin->taddr,coin->pubtype,coin->p2shtype,address)); - return(cJSON_Parse("{\"error\":\"couldnt import\"}")); - } else return(cJSON_Parse("{\"result\":\"success\"}")); + for (i=0; i<3; i++) + { + printf("%s importaddress %s from %s failed, isvalid.%d\n",symbol,address,wifstr,bitcoin_validaddress(symbol,coin->taddr,coin->pubtype,coin->p2shtype,address)); + if ( LP_importaddress(symbol,address) >= 0 ) + break; + } + if ( i == 3 ) + return(cJSON_Parse("{\"error\":\"couldnt import\"}")); + } + return(cJSON_Parse("{\"result\":\"success\"}")); #endif if ( (retjson= LP_validateaddress(symbol,address)) != 0 ) { From 56e4e8f504f0c9757bf359303f0f878841fe7dd1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:38:45 +0300 Subject: [PATCH 87/98] Test --- iguana/exchanges/LP_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2c7763930..17efc8779 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -623,7 +623,7 @@ int32_t LP_importaddress(char *symbol,char *address) { if ( (validatejson= LP_validateaddress(symbol,address)) != 0 ) { - //printf("validated.(%s)\n",jprint(validatejson,0)); + printf("validated.(%s)\n",jprint(validatejson,0)); if ( (isvalid= is_cJSON_True(jobj(validatejson,"isvalid")) != 0) != 0 ) { if ( is_cJSON_True(jobj(validatejson,"iswatchonly")) != 0 || is_cJSON_True(jobj(validatejson,"watchonly")) != 0 || is_cJSON_True(jobj(validatejson,"ismine")) != 0 ) @@ -631,7 +631,7 @@ int32_t LP_importaddress(char *symbol,char *address) } free_json(validatejson); } - //printf("%s (%s) isvalid.%d doneflag.%d\n",symbol,address,isvalid,doneflag); + printf("%s (%s) isvalid.%d doneflag.%d\n",symbol,address,isvalid,doneflag); if ( isvalid == 0 ) return(-1); if ( doneflag != 0 ) @@ -639,7 +639,7 @@ int32_t LP_importaddress(char *symbol,char *address) sprintf(buf,"[\"%s\", \"%s\", false]",address,address); if ( (retstr= bitcoind_passthru(symbol,coin->serverport,coin->userpass,"importaddress",buf)) != 0 ) { - //printf("importaddress.(%s %s) -> (%s)\n",symbol,address,retstr); + printf("importaddress.(%s %s) -> (%s)\n",symbol,address,retstr); free(retstr); } //else printf("importaddress.(%s %s)\n",symbol,address); return(1); From aba2366eace64174b0586399ec2bfa8c928cc697 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:40:48 +0300 Subject: [PATCH 88/98] Allow impogrtaddress in disabled chain --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 17efc8779..dfe7d62f0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); - if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getaddressinfo") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) + if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getaddressinfo") == 0 || strcmp(method,"importaddress") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) { if ( coin->electrum == 0 ) { From 332b80bc8465da457c269f34a8d96a60806e4392 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:44:20 +0300 Subject: [PATCH 89/98] Allow a few rpc calls to disabled coins --- iguana/exchanges/LP_rpc.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index dfe7d62f0..1d9477574 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); - if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getaddressinfo") == 0 || strcmp(method,"importaddress") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) + if ( coin->inactive == 0 && (strcmp(method,"importprivkey") != 0 && strcmp(method,"validateaddress") != 0 && strcmp(method,"getaddressinfo") != 0 && strcmp(method,"importaddress") != 0 && strcmp(method,"getrawtransaction") != 0 && strcmp(method,"getblock") != 0 && strcmp(method,"getinfo") != 0 && strcmp(method,"getblockchaininfo") == 0) ) { if ( coin->electrum == 0 ) { @@ -649,7 +649,7 @@ int32_t LP_importaddress(char *symbol,char *address) cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) { static void *ctx; - char buf[512],address[64]; cJSON *retjson; struct iguana_info *coin; int32_t i,doneflag = 0; + char buf[512],address[64]; cJSON *retjson; struct iguana_info *coin; int32_t doneflag = 0; if ( symbol == 0 || symbol[0] == 0 ) return(cJSON_Parse("{\"error\":\"null symbol\"}")); coin = LP_coinfind(symbol); @@ -663,16 +663,9 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) #ifdef LP_DONT_IMPORTPRIVKEY if ( LP_importaddress(symbol,address) < 0 ) { - for (i=0; i<3; i++) - { - printf("%s importaddress %s from %s failed, isvalid.%d\n",symbol,address,wifstr,bitcoin_validaddress(symbol,coin->taddr,coin->pubtype,coin->p2shtype,address)); - if ( LP_importaddress(symbol,address) >= 0 ) - break; - } - if ( i == 3 ) - return(cJSON_Parse("{\"error\":\"couldnt import\"}")); - } - return(cJSON_Parse("{\"result\":\"success\"}")); + printf("%s importaddress %s from %s failed, isvalid.%d\n",symbol,address,wifstr,bitcoin_validaddress(symbol,coin->taddr,coin->pubtype,coin->p2shtype,address)); + return(cJSON_Parse("{\"error\":\"couldnt import\"}")); + } else return(cJSON_Parse("{\"result\":\"success\"}")); #endif if ( (retjson= LP_validateaddress(symbol,address)) != 0 ) { From fdcca4336a13e61313d5e46c50f11c0627a2b91f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:45:50 +0300 Subject: [PATCH 90/98] Test --- iguana/exchanges/LP_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1d9477574..1f7ff25f1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); - if ( coin->inactive == 0 && (strcmp(method,"importprivkey") != 0 && strcmp(method,"validateaddress") != 0 && strcmp(method,"getaddressinfo") != 0 && strcmp(method,"importaddress") != 0 && strcmp(method,"getrawtransaction") != 0 && strcmp(method,"getblock") != 0 && strcmp(method,"getinfo") != 0 && strcmp(method,"getblockchaininfo") == 0) ) + //if ( coin->inactive == 0 && (strcmp(method,"importprivkey") != 0 && strcmp(method,"validateaddress") != 0 && strcmp(method,"getaddressinfo") != 0 && strcmp(method,"importaddress") != 0 && strcmp(method,"getrawtransaction") != 0 && strcmp(method,"getblock") != 0 && strcmp(method,"getinfo") != 0 && strcmp(method,"getblockchaininfo") == 0) ) { if ( coin->electrum == 0 ) { @@ -77,7 +77,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) } } } - } else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); + } //else retjson = cJSON_Parse("{\"result\":\"disabled\"}"); } else printf("bitcoin_json cant talk to NULL coin\n"); return(retjson); } @@ -346,7 +346,7 @@ cJSON *LP_validateaddress(char *symbol,char *address) sprintf(buf,"[\"%s\"]",address); if ( (retjson= bitcoin_json(coin,coin->validateaddress,buf)) != 0 ) { - if ( jobj(retjson,"ismine") == 0 && strcmp(coin->validateaddress,"validateaddress") == 0 ) + if ( jobj(retjson,"error") == 0 && jobj(retjson,"ismine") == 0 && strcmp(coin->validateaddress,"validateaddress") == 0 ) { printf("autochange %s validateaddress -> getaddressinfo\n",coin->symbol); strcpy(coin->validateaddress,"getaddressinfo"); From fa1c79f5a5aceb558612d52a63cf499cbad62669 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:49:04 +0300 Subject: [PATCH 91/98] Test --- iguana/exchanges/LP_coins.c | 3 +++ iguana/exchanges/LP_rpc.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 23ebc15b8..3722ad819 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -367,6 +367,9 @@ struct iguana_info *LP_coinadd(struct iguana_info *cdata) portable_mutex_lock(&LP_coinmutex); HASH_ADD_KEYPTR(hh,LP_coins,coin->symbol,strlen(coin->symbol),coin); portable_mutex_unlock(&LP_coinmutex); + strcpy(coin->validateaddress,"validateaddress"); + strcpy(coin->getinfostr,"getinfo"); + strcpy(coin->estimatefeestr,"estimatefee"); return(coin); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1f7ff25f1..90a9e3c08 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); - //if ( coin->inactive == 0 && (strcmp(method,"importprivkey") != 0 && strcmp(method,"validateaddress") != 0 && strcmp(method,"getaddressinfo") != 0 && strcmp(method,"importaddress") != 0 && strcmp(method,"getrawtransaction") != 0 && strcmp(method,"getblock") != 0 && strcmp(method,"getinfo") != 0 && strcmp(method,"getblockchaininfo") == 0) ) + //if ( coin->inactive == 0 && (strcmp(method,"importprivkey") != 0 && strcmp(method,"validateaddress") != 0 && strcmp(method,"getaddressinfo") != 0 && strcmp(method,"importaddress") != 0 && strcmp(method,"getrawtransaction") != 0 && strcmp(method,"getblock") != 0 && strcmp(method,"getinfo") != 0 && strcmp(method,"getblockchaininfo") != 0) ) { if ( coin->electrum == 0 ) { @@ -344,6 +344,8 @@ cJSON *LP_validateaddress(char *symbol,char *address) else { sprintf(buf,"[\"%s\"]",address); + if ( coin->validateaddress[0] == 0 ) + strcpy(coin->validateaddress,"validateaddress"); if ( (retjson= bitcoin_json(coin,coin->validateaddress,buf)) != 0 ) { if ( jobj(retjson,"error") == 0 && jobj(retjson,"ismine") == 0 && strcmp(coin->validateaddress,"validateaddress") == 0 ) From d0db5bfef1f0f536686f500b7ceab0071b8d85e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:50:08 +0300 Subject: [PATCH 92/98] -print --- iguana/exchanges/LP_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 90a9e3c08..7ac8766bd 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); - //if ( coin->inactive == 0 && (strcmp(method,"importprivkey") != 0 && strcmp(method,"validateaddress") != 0 && strcmp(method,"getaddressinfo") != 0 && strcmp(method,"importaddress") != 0 && strcmp(method,"getrawtransaction") != 0 && strcmp(method,"getblock") != 0 && strcmp(method,"getinfo") != 0 && strcmp(method,"getblockchaininfo") != 0) ) + if ( coin->inactive == 0 && (strcmp(method,"importprivkey") != 0 && strcmp(method,"validateaddress") != 0 && strcmp(method,"getaddressinfo") != 0 && strcmp(method,"importaddress") != 0 && strcmp(method,"getrawtransaction") != 0 && strcmp(method,"getblock") != 0 && strcmp(method,"getinfo") != 0 && strcmp(method,"getblockchaininfo") != 0) ) { if ( coin->electrum == 0 ) { @@ -625,7 +625,7 @@ int32_t LP_importaddress(char *symbol,char *address) { if ( (validatejson= LP_validateaddress(symbol,address)) != 0 ) { - printf("validated.(%s)\n",jprint(validatejson,0)); + //printf("validated.(%s)\n",jprint(validatejson,0)); if ( (isvalid= is_cJSON_True(jobj(validatejson,"isvalid")) != 0) != 0 ) { if ( is_cJSON_True(jobj(validatejson,"iswatchonly")) != 0 || is_cJSON_True(jobj(validatejson,"watchonly")) != 0 || is_cJSON_True(jobj(validatejson,"ismine")) != 0 ) @@ -633,7 +633,7 @@ int32_t LP_importaddress(char *symbol,char *address) } free_json(validatejson); } - printf("%s (%s) isvalid.%d doneflag.%d\n",symbol,address,isvalid,doneflag); + //printf("%s (%s) isvalid.%d doneflag.%d\n",symbol,address,isvalid,doneflag); if ( isvalid == 0 ) return(-1); if ( doneflag != 0 ) From 35ed6aad18d17fb71a65bace0a586312b4c91f34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:52:21 +0300 Subject: [PATCH 93/98] Fix --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 7ac8766bd..f76cdc6b2 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); - if ( coin->inactive == 0 && (strcmp(method,"importprivkey") != 0 && strcmp(method,"validateaddress") != 0 && strcmp(method,"getaddressinfo") != 0 && strcmp(method,"importaddress") != 0 && strcmp(method,"getrawtransaction") != 0 && strcmp(method,"getblock") != 0 && strcmp(method,"getinfo") != 0 && strcmp(method,"getblockchaininfo") != 0) ) + if ( coin->inactive == 0 && (strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getaddressinfo") == 0 || strcmp(method,"importaddress") == 0) ) { if ( coin->electrum == 0 ) { From 61faa30793470a7bef88a3d1693be1d7a3e2d3c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 13:53:27 +0300 Subject: [PATCH 94/98] Fix --- iguana/exchanges/LP_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f76cdc6b2..626fba0a0 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) // printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params); if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); - if ( coin->inactive == 0 && (strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getaddressinfo") == 0 || strcmp(method,"importaddress") == 0) ) + if ( coin->inactive == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getaddressinfo") == 0 || strcmp(method,"importaddress") == 0 ) { if ( coin->electrum == 0 ) { From 79d39e3cef9c08a9f37129e963315e26664c2a78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 14:13:08 +0300 Subject: [PATCH 95/98] Active api --- iguana/iguana_notary.c | 18 ++++++++++-------- iguana/tests/active | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100755 iguana/tests/active diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index ecb45b3a7..7be7fca29 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -857,6 +857,8 @@ STRING_AND_INT(dpow,fundnotaries,symbol,numblocks) return(clonestr("{\"result\":\"success\"}")); } +extern char *Notaries_elected[65][2]; + STRING_ARG(dpow,active,maskhex) { uint8_t data[8],revdata[8],pubkeys[64][33]; char pubkeystr[67]; int32_t i,len,current,n; uint64_t mask; cJSON *infojson,*retjson,*array = cJSON_CreateArray(); @@ -874,7 +876,7 @@ STRING_ARG(dpow,active,maskhex) if ( ((1LL << i) & mask) != 0 ) { init_hexbytes_noT(pubkeystr,pubkeys[i],33); - printf("(%d %llx %s) ",i,(long long)(1LL << i),pubkeystr); + //printf("(%d %llx %s) ",i,(long long)(1LL << i),pubkeystr); jaddistr(array,pubkeystr); } } @@ -883,7 +885,7 @@ STRING_ARG(dpow,active,maskhex) jadd(retjson,"notaries",array); return(jprint(retjson,1)); } - printf("dpow active (%s)\n",maskhex); + //printf("dpow active (%s)\n",maskhex); if ( (len= (int32_t)strlen(maskhex)) <= 16 ) { len >>= 1; @@ -893,15 +895,15 @@ STRING_ARG(dpow,active,maskhex) revdata[i] = data[len-1-i]; mask = 0; memcpy(&mask,revdata,sizeof(revdata)); - for (i=0; i Date: Mon, 30 Apr 2018 14:19:05 +0300 Subject: [PATCH 96/98] Good/bad to active return --- iguana/iguana_notary.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 7be7fca29..1a49df395 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -861,7 +861,9 @@ extern char *Notaries_elected[65][2]; STRING_ARG(dpow,active,maskhex) { - uint8_t data[8],revdata[8],pubkeys[64][33]; char pubkeystr[67]; int32_t i,len,current,n; uint64_t mask; cJSON *infojson,*retjson,*array = cJSON_CreateArray(); + uint8_t data[8],revdata[8],pubkeys[64][33]; char pubkeystr[67]; int32_t i,len,current,n; uint64_t mask; cJSON *infojson,*retjson,*array,*notarray; + array = cJSON_CreateArray(); + notarray = cJSON_CreateArray(); if ( (infojson= dpow_getinfo(myinfo,coin)) != 0 ) { current = jint(infojson,"blocks"); @@ -899,13 +901,19 @@ STRING_ARG(dpow,active,maskhex) // printf("%02x",data[i]); //printf(" <- hex mask.%llx\n",(long long)mask); for (i=0; i<(len<<3); i++) + { if ( ((1LL << i) & mask) != 0 ) { //init_hexbytes_noT(pubkeystr,pubkeys[i],33); //printf("(%d %llx %s) ",i,(long long)(1LL << i),pubkeystr); jaddistr(array,Notaries_elected[i][0]); } - return(jprint(array,1)); + else jaddistr(notarray,Notaries_elected[i][0]); + } + retjson = cJSON_CreateArray(); + jadd(retjson,"good",array); + jadd(retjson,"bad",notarray); + return(jprint(retjson,1)); } else return(clonestr("{\"error\":\"maskhex too long\"}")); } From 8cce9595c038cfae5760301c1f107f58203c4ff5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 14:22:51 +0300 Subject: [PATCH 97/98] Print --- iguana/iguana_notary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 1a49df395..aa5337593 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -911,8 +911,8 @@ STRING_ARG(dpow,active,maskhex) else jaddistr(notarray,Notaries_elected[i][0]); } retjson = cJSON_CreateArray(); - jadd(retjson,"good",array); - jadd(retjson,"bad",notarray); + jadd(retjson,"set",array); + jadd(retjson,"not",notarray); return(jprint(retjson,1)); } else return(clonestr("{\"error\":\"maskhex too long\"}")); } From be95c9d23118f36578da1d7200d7e3261d7dc8e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 14:24:16 +0300 Subject: [PATCH 98/98] Array -> object --- iguana/iguana_notary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index aa5337593..cfab2d931 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -910,7 +910,7 @@ STRING_ARG(dpow,active,maskhex) } else jaddistr(notarray,Notaries_elected[i][0]); } - retjson = cJSON_CreateArray(); + retjson = cJSON_CreateObject(); jadd(retjson,"set",array); jadd(retjson,"not",notarray); return(jprint(retjson,1));